public void ProcessResult(bool result,StatePlayer player, MonsterInfo monster)
    {
        //無損戰鬥
        if (result)
        {
            player.addExp((int)(monster.getExp() * ComboBonusSystem.Instance.getComboBonus()));
            
        }
        else
        {
            List<passiveSkill> list = MainGame.Instance.m_StatePlayer.playerSkillList;
            int resultDamage = monster.getAttack();
            for(int i = 0;i < list.Count; i++)
            {
                if(list[i].getType() == passiveSkill.passiveSkillType.DECREASE_DAMAGE)
                {
                    resultDamage = (int)(resultDamage * ((passiveSkill_decreaseDamage)list[i]).getValue());
                }
            }

            MessageManager.Instance.showMask(Color.red, 0.1f);
            MessageManager.Instance.showInfoMessage("HP - " + monster.getAttack(), Color.red);
            player.hpDamage(monster.getAttack());
            player.addExp((int)(monster.getExp() * ComboBonusSystem.Instance.getComboBonus()));
        }

        TouchControl.mybtnClone.showContent();
    }
Esempio n. 2
0
 public GameUIToolTip CreateMonsterTooltip(Transform parent, MonsterInfo petInfo)
 {
     Tools.Assert(parent, "Invalid parent");
     this.mStringBuilder.Remove(0, this.mStringBuilder.Length);
     this.mStringBuilder.Append("Tooltip_").Append(petInfo.ID);
     return this.LoadToolTipPerfab(parent, this.mStringBuilder.ToString());
 }
Esempio n. 3
0
 public void OnBossRespawnEvent(int slot, MonsterInfo info)
 {
     this.ShowBossTipText(Singleton<StringManager>.Instance.GetString("worldBossTxt15", new object[]
     {
         info.Name
     }));
 }
Esempio n. 4
0
 public void Init(MonsterInfo info, bool showTips)
 {
     if (info == null)
     {
         base.gameObject.SetActive(false);
         return;
     }
     this.mShowTips = showTips;
     this.icon = base.transform.FindChild("icon").GetComponent<UISprite>();
     if (showTips)
     {
         if (this.icon.collider != null)
         {
             this.icon.collider.enabled = true;
         }
         UIEventListener expr_72 = UIEventListener.Get(this.icon.gameObject);
         expr_72.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_72.onPress, new UIEventListener.BoolDelegate(this.OnEnemyItemPress));
     }
     else if (this.icon.collider != null)
     {
         this.icon.collider.enabled = false;
     }
     this.propertyBg = base.transform.GetComponent<UISprite>();
     this.Refresh(info);
 }
Esempio n. 5
0
 public void OnBossDeadEvent(int slot, MonsterInfo info, string playerName)
 {
     if (slot == 5)
     {
         GameUIManager.mInstance.uiState.WorldBossIsOver = true;
         this.updateTime = false;
         GUIBossReadyScene.SendGetBossDataMsg();
     }
 }
Esempio n. 6
0
 private void Refresh(MonsterInfo info)
 {
     this.propertyBg.spriteName = Tools.GetItemQualityIcon(info.Quality);
     this.icon.spriteName = info.Icon;
     if (this.mShowTips)
     {
         this.icon.gameObject.name = info.ID.ToString();
     }
 }
Esempio n. 7
0
        private static void LoadMonsterInfo()
        {
            using (StreamReader rdr = new StreamReader(CryptApi.DecryptStream(GetStream(), CryptApi.NoxCryptFormat.MONSTER)))
            {
                string line;
                MonsterInfo minfo = new MonsterInfo();
                bool monsterBlock = false;
                while (!rdr.EndOfStream)
                {
                    line = rdr.ReadLine();

                    if (!monsterBlock && line.Length > 1)
                    {
                        minfo = new MonsterInfo();
                        minfo.Name = line;
                        monsterBlock = true;
                        continue;
                    }
                    if (line == "END")
                    {
                        monsterBlock = false;
                        MonsterDict.Add(minfo.Name, minfo);
                        continue;
                    }
                    string[] split = line.Split(' ');

                    string type = "", val = "";
                    foreach (string s in split)
                    {
                        if (s.Length > 0)
                        {
                            if (s == "ARENA") break; // ignore arena entries
                            if (s == "SOLO") continue;
                            if (type.Length == 0) type = s;
                            else val = s;
                        }
                    }

                    switch (type)
                    {
                        case "HEALTH":
                            minfo.Health = int.Parse(val);
                            break;
                        case "RETREAT_RATIO":
                            minfo.RetreatRatio = float.Parse(val, NumberFormatInfo.InvariantInfo);
                            break;
                        case "RESUME_RATIO":
                            minfo.ResumeRatio = float.Parse(val, NumberFormatInfo.InvariantInfo);
                            break;
                        case "STATUS":
                            minfo.Status = val;
                            break;
                    }
                }
            }
        }
Esempio n. 8
0
 public void OnBossDeadEvent(int slot, MonsterInfo info, string playerName)
 {
     WorldBossSubSystem worldBossSystem = Globals.Instance.Player.WorldBossSystem;
     this.RefreshBossItemInfo(worldBossSystem.GetBossData(slot), info, false);
     if (slot == 5)
     {
         this.updateTime = false;
         this.BackBossScene();
     }
 }
Esempio n. 9
0
 public void OnBossDeadEvent(int slot, MonsterInfo info, string playerName)
 {
     if (slot == Globals.Instance.Player.WorldBossSystem.CurSlot || slot == 5)
     {
         return;
     }
     this.ShowBossTipText(Singleton<StringManager>.Instance.GetString("worldBossTxt14", new object[]
     {
         info.Name,
         playerName
     }));
 }
Esempio n. 10
0
 public void ResetInfo()
 {
     if (this.Info == null || this.Data.InfoID != this.Info.ID)
     {
         this.Info = Globals.Instance.AttDB.MonsterDict.GetInfo(this.Data.InfoID);
         if (this.Info == null)
         {
             Debug.LogError(new object[]
             {
                 string.Format("MonsterDict.GetInfo error, ID = {0}", this.Data.InfoID)
             });
         }
     }
 }
Esempio n. 11
0
 public void Refresh(MonsterInfo mInfo)
 {
     this.mMonsterInfo = mInfo;
     if (this.mMonsterInfo != null)
     {
         base.gameObject.SetActive(true);
         this.mMonsterIcon.spriteName = this.mMonsterInfo.Icon;
         this.mQualityMask.spriteName = Tools.GetItemQualityIcon(this.mMonsterInfo.Quality);
         this.mBossMark.SetActive(this.mMonsterInfo.BossType != 0);
     }
     else
     {
         base.gameObject.SetActive(false);
     }
 }
Esempio n. 12
0
 public void OnDoBossDamageEvent(int slot, MonsterInfo info, string playerName, long damage, int type)
 {
     WorldBossSubSystem worldBossSystem = Globals.Instance.Player.WorldBossSystem;
     this.RefreshBossItemInfo(worldBossSystem.GetBossData(slot), info, false);
     this.ShowCombatDamageText((type == 0) ? Singleton<StringManager>.Instance.GetString("worldBossTxt18", new object[]
     {
         playerName,
         info.Name,
         damage
     }) : Singleton<StringManager>.Instance.GetString("worldBossTxt19", new object[]
     {
         playerName,
         info.Name,
         damage
     }));
 }
	public void SetMonsterStats(GameObject monster, MonsterInfo info)
	{
		MonsterComponent monsterComponent = monster.GetComponent<MonsterComponent>();
		AttackManager attackComponent = monster.GetComponentInChildren<AttackManager>();
		
		monsterComponent.Health = info.health;
		monsterComponent.MaxHealth = info.health;
		monsterComponent.MoveSpeed = info.movementSpeed;
		
		if (attackComponent != null)
		{
			attackComponent.attackDamage = info.attackDamage;
			attackComponent.AttackRange = info.attackRange;
			attackComponent.AttackChargeTime = info.attackChargeTime;
			attackComponent.TimeBetweenAttacks = info.timeBetweenAttacks;			
		}		
	}
Esempio n. 14
0
 private void CreateModel(MonsterInfo monsterInfo)
 {
     this.DestroyModel();
     if (monsterInfo != null)
     {
         this.asyncEntiry = ActorManager.CreateUIMonster(monsterInfo, 0, false, false, this.mMonsterModelPos, 1f, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mMonsterModel = go;
         });
     }
 }
Esempio n. 15
0
 public void SetAssistInfo(PetInfo pInfo, MonsterInfo mInfo, bool addSkill = true)
 {
     if (pInfo == null || mInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             "pInfo == null || mInfo == null"
         });
         return;
     }
     this.actorType = ActorController.EActorType.EPet;
     this.petInfo = pInfo;
     this.factionType = ActorController.EFactionType.EBlue;
     this.Level = mInfo.Level;
     this.ElementType = pInfo.ElementType;
     this.attInit[1] = (long)mInfo.MaxHP;
     this.attInit[2] = (long)mInfo.Attack;
     this.attInit[3] = (long)mInfo.PhysicDefense;
     this.attInit[4] = (long)mInfo.MagicDefense;
     this.attInit[5] = (long)mInfo.Hit;
     this.attInit[6] = (long)mInfo.Dodge;
     this.attInit[7] = (long)mInfo.Crit;
     this.attInit[8] = (long)mInfo.CritResist;
     this.attInit[9] = (long)((ulong)mInfo.DamagePlus);
     this.attInit[10] = (long)((ulong)mInfo.DamageMinus);
     this.resist[1] = mInfo.StunResist;
     this.resist[2] = mInfo.RootResist;
     this.resist[3] = mInfo.FearResist;
     this.resist[4] = mInfo.HitBackResist;
     this.resist[5] = mInfo.HitDownResist;
     this.resist[6] = mInfo.SilenceResist;
     if (addSkill)
     {
         for (int i = 0; i < mInfo.SkillID.Count; i++)
         {
             if (mInfo.SkillID[i] != 0)
             {
                 this.AddSkill(i, mInfo.SkillID[i], false);
             }
         }
     }
     this.Init();
 }
Esempio n. 16
0
 private void OnGuildBossDeadEvent(int id, MonsterInfo info, string playerName)
 {
     this.ShowBossTipText(Singleton<StringManager>.Instance.GetString("worldBossTxt14", new object[]
     {
         info.Name,
         playerName
     }));
 }
Esempio n. 17
0
 private void OnGuildDoBossDamageEvent(int id, MonsterInfo info, string playerName, long damage)
 {
     GuildBossData curGuildBossData = Globals.Instance.Player.GuildSystem.GetCurGuildBossData();
     if (curGuildBossData == null || info == null || id != curGuildBossData.ID || info.ID != curGuildBossData.InfoID || this.bossActor == null)
     {
         return;
     }
     this.bossActor.DamageRecount = false;
     this.bossActor.DoDamage(damage, null, false);
     this.bossActor.DamageRecount = true;
     long num = (long)((float)this.bossActor.MaxHP * curGuildBossData.HealthPct);
     if (this.bossActor.CurHP > num)
     {
         this.bossActor.CurHP = num;
     }
 }
Esempio n. 18
0
 public virtual void OnDoDamage(MonsterInfo info, long damage)
 {
 }
Esempio n. 19
0
 protected internal FinialTurtle(MonsterInfo info)
     : base(info)
 {
 }
Esempio n. 20
0
 private void RefreshBossItemInfo(BossData data, MonsterInfo info, bool createActor = false)
 {
     GUIBossMapScene.BossItemInfo item = this.mBossItems[data.Slot - 1];
     if (info != null)
     {
         item.bossName.text = string.Format("[fd8e00]Lv{0}[-] {1}", info.Level, info.Name);
     }
     if (data.Slot == 5)
     {
         if (info != null)
         {
             item.hpSlider.gameObject.SetActive(true);
             item.bossBg.localPosition = new Vector3(190f, -35f, 0f);
         }
         else
         {
             item.hpSlider.gameObject.SetActive(false);
             item.bossBg.localPosition = new Vector3(190f, -14f, 0f);
         }
     }
     if (info != null && data.HealthPct > 0f)
     {
         item.slot.normalSprite = ((data.Slot != 5) ? "easy" : "hard");
     }
     else
     {
         item.slot.normalSprite = "Disable";
     }
     item.slot.gameObject.SetActive(info != null);
     item.bossBg.parent.gameObject.SetActive(info != null);
     if (info != null && createActor && data.Slot != 5)
     {
         if (item.bossActor != null)
         {
             UnityEngine.Object.DestroyImmediate(item.bossActor);
             item.bossActor = null;
         }
         GUIWorldMap.CreateWorldMapActorAsnc(info.ResLoc, string.Empty, base.transform, info.ScaleInUI * 1.25f, 180f, delegate(GameObject bossActor)
         {
             if (bossActor != null)
             {
                 bossActor.transform.localPosition = this.WORLD_BOSS_POS[data.Slot - 1];
                 bossActor.animation.clip = bossActor.animation.GetClip("std");
                 bossActor.animation.wrapMode = WrapMode.Loop;
                 bossActor.SetActive(true);
                 item.bossActor = bossActor;
             }
         });
         item.bossIcon.spriteName = Tools.GetPropertyIconWithBorder((EElementType)info.ElementType);
     }
 }
Esempio n. 21
0
 public GenderDecision( MonsterGender g, MonsterInfo t )
 {
     ExpectedGender = g;
     TypeGenderByte = t.Gender;
 }
Esempio n. 22
0
 private void OnBossDeadEvent(int slot, MonsterInfo info, string playerName)
 {
     BossData curBossData = Globals.Instance.Player.WorldBossSystem.GetCurBossData();
     if (curBossData == null || info == null || (slot != 5 && (info.ID != curBossData.InfoID || slot != curBossData.Slot)))
     {
         return;
     }
     if (this.bossActor != null)
     {
         this.bossActor.Undead = false;
         this.bossActor.DamageRecount = false;
         this.bossActor.DoDamage(this.bossActor.MaxHP, null, false);
     }
     GameUIManager.mInstance.uiState.WorldBossKillerName = playerName;
     if (this.status != 1)
     {
         GameAnalytics.OnFinishScene(GameUIManager.mInstance.uiState.CurSceneInfo);
         Globals.Instance.SenceMgr.CloseScene();
         GameUIManager.mInstance.ChangeSession<GUIWorldBossVictoryScene>(null, false, false);
         this.status = 3;
     }
     this.isBossDead = true;
 }
Esempio n. 23
0
 public void OnDoDamage(MonsterInfo info, long damage)
 {
     this.baseScene.OnDoDamage(info, damage);
 }
Esempio n. 24
0
 public static ResourceEntity CreateUIMonster(MonsterInfo mInfo, int depth = 0, bool playAction = true, bool canRotate = true, GameObject parent = null, float scale = 1f, Action<GameObject> callback = null)
 {
     if (mInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             "MonsterInfo == null"
         });
         if (callback != null)
         {
             callback(null);
         }
         return null;
     }
     return ActorManager.CreateUIActorAsync(mInfo.ResLoc, string.Empty, mInfo.ScaleInUI * scale, depth, playAction, canRotate, parent, 0, string.Empty, 180f, callback);
 }
	private void LoadMonsterInfo(string monsterName)
	{
		MonsterInfo monsterInfo = new MonsterInfo ();
			
		if (xmlDoc != null) 
		{
			XmlNode monsterNode = xmlDoc.SelectSingleNode ("/monsters/monster[@name=\'" + monsterName + "\']");
				
			if (monsterNode != null) 
			{
				monsterInfo.UISpriteName = monsterNode.SelectSingleNode ("./UISprite").InnerText;
				
				monsterInfo.gameName = monsterName;
				monsterInfo.gameName = monsterNode.SelectSingleNode ("./gameName").InnerText;
					
				XmlNode statsNode = monsterNode.SelectSingleNode ("./stats");
					
				if (statsNode != null) {
					float health, attackSpeed, attackDamage, attackRange, movementSpeed, spawnTime;
					int maxAlive;
					AttackType attackType;
						
					float.TryParse (statsNode.SelectSingleNode ("./health").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out health);
					float.TryParse (statsNode.SelectSingleNode ("./attackSpeed").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out attackSpeed);
					float.TryParse (statsNode.SelectSingleNode ("./attackDamage").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out attackDamage);
					float.TryParse (statsNode.SelectSingleNode ("./attackRange").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out attackRange);
					float.TryParse (statsNode.SelectSingleNode ("./movementSpeed").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out movementSpeed);
					float.TryParse (statsNode.SelectSingleNode ("./spawnTime").InnerText, NumberStyles.Float, CultureInfo.InvariantCulture, out spawnTime);
					
					int.TryParse (statsNode.SelectSingleNode ("./maxAlive").InnerText, NumberStyles.Integer, CultureInfo.InvariantCulture, out maxAlive);	
									
					attackType = (AttackType)Enum.Parse (typeof(AttackType), statsNode.SelectSingleNode ("./attackType").InnerText);
						
					monsterInfo.health = health;
					monsterInfo.timeBetweenAttacks = attackSpeed;
					monsterInfo.attackDamage = attackDamage;
					monsterInfo.attackRange = attackRange;
					monsterInfo.attackType = attackType;
					monsterInfo.movementSpeed = movementSpeed;
					monsterInfo.spawnTime = spawnTime;
					
					monsterInfo.maxAlive = maxAlive;
				}		
					
				cachedReads.Add (monsterName, monsterInfo);
			} else
				Debug.LogError ("Could not find monster name " + monsterName + " in the Monster XML Document.");
		} else
			Debug.LogError ("Monster XML Document not loaded.");
	}
Esempio n. 26
0
 protected internal GeneralJinmYo(MonsterInfo info)
     : base(info)
 {
 }
Esempio n. 27
0
 public void SetMonsterInfo(MonsterInfo mInfo, SceneInfo sceneInfo, int attScale = 10000, ActorController.EFactionType faction = ActorController.EFactionType.ERed)
 {
     if (mInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             "mInfo == null"
         });
         return;
     }
     this.actorType = ActorController.EActorType.EMonster;
     this.monsterInfo = mInfo;
     this.factionType = faction;
     this.Level = this.monsterInfo.Level;
     this.ElementType = this.monsterInfo.ElementType;
     if (this.MaxRunSpeed <= 0f)
     {
         this.canRotate = false;
     }
     if (sceneInfo != null && sceneInfo.Type == 6 && GameUIManager.mInstance.uiState.KRQuest != null)
     {
         this.Level = Globals.Instance.Player.Data.Level;
         KRQuestInfo kRQuest = GameUIManager.mInstance.uiState.KRQuest;
         this.attInit[1] = (long)mInfo.MaxHP * (long)kRQuest.MaxHPScale / 10000L;
         this.attInit[2] = (long)mInfo.Attack * (long)kRQuest.AttackScale / 10000L;
         this.attInit[3] = (long)mInfo.PhysicDefense * (long)kRQuest.PhysicDefenseScale / 10000L;
         this.attInit[4] = (long)mInfo.MagicDefense * (long)kRQuest.MagicDefenseScale / 10000L;
         this.attInit[5] = (long)mInfo.Hit * (long)kRQuest.HitScale / 10000L;
         this.attInit[6] = (long)mInfo.Dodge * (long)kRQuest.DodgeScale / 10000L;
         this.attInit[7] = (long)mInfo.Crit * (long)kRQuest.CritScale / 10000L;
         this.attInit[8] = (long)mInfo.CritResist * (long)kRQuest.CritResisScale / 10000L;
         this.attInit[9] = (long)mInfo.DamagePlus * (long)kRQuest.DamagePlusScale / 10000L;
         this.attInit[10] = (long)mInfo.DamageMinus * (long)kRQuest.DamageMinusScale / 10000L;
     }
     else
     {
         this.attInit[1] = (long)mInfo.MaxHP * (long)attScale / 10000L;
         this.attInit[2] = (long)mInfo.Attack * (long)attScale / 10000L;
         this.attInit[3] = (long)mInfo.PhysicDefense * (long)attScale / 10000L;
         this.attInit[4] = (long)mInfo.MagicDefense * (long)attScale / 10000L;
         this.attInit[5] = (long)mInfo.Hit * (long)attScale / 10000L;
         this.attInit[6] = (long)mInfo.Dodge * (long)attScale / 10000L;
         this.attInit[7] = (long)mInfo.Crit * (long)attScale / 10000L;
         this.attInit[8] = (long)mInfo.CritResist * (long)attScale / 10000L;
         this.attInit[9] = (long)mInfo.DamagePlus * (long)attScale / 10000L;
         this.attInit[10] = (long)mInfo.DamageMinus * (long)attScale / 10000L;
     }
     this.resist[1] = mInfo.StunResist;
     this.resist[2] = mInfo.RootResist;
     this.resist[3] = mInfo.FearResist;
     this.resist[4] = mInfo.HitBackResist;
     this.resist[5] = mInfo.HitDownResist;
     this.resist[6] = mInfo.SilenceResist;
     for (int i = 0; i < this.monsterInfo.SkillID.Count; i++)
     {
         if (this.monsterInfo.SkillID[i] != 0)
         {
             this.AddSkill(i, this.monsterInfo.SkillID[i], false);
         }
     }
     this.Init();
     this.CastPassiveSkill();
 }
Esempio n. 28
0
 public static void CreateMonsterPrefabPool(MonsterInfo mInfo)
 {
     if (mInfo == null)
     {
         return;
     }
     for (int i = 0; i < mInfo.SkillID.Count; i++)
     {
         PoolMgr.CreateSkillPrefabPool(mInfo.SkillID[i]);
     }
     if (EffectSoundManager.IsEffectSoundOptionOn())
     {
         Globals.Instance.EffectSoundMgr.CacheSoundResourceSync(mInfo.HitSound, 360f);
         Globals.Instance.EffectSoundMgr.CacheSoundResourceSync(mInfo.DeadSound, 360f);
     }
 }
Esempio n. 29
0
 public override void OnDoDamage(MonsterInfo info, long damage)
 {
     this.totalDamage += damage;
 }
Esempio n. 30
0
 public void OnDoBossDamageEvent(int slot, MonsterInfo info, string playerName, long damage, int type)
 {
     this.ShowBossTipText(Singleton<StringManager>.Instance.GetString("worldBossTxt16", new object[]
     {
         playerName,
         info.Name,
         damage
     }));
 }
Esempio n. 31
0
 private void OnGuildBossDeadEvent(int id, MonsterInfo info, string playerName)
 {
     GuildBossData curGuildBossData = Globals.Instance.Player.GuildSystem.GetCurGuildBossData();
     if (curGuildBossData == null || info == null || id != curGuildBossData.ID || info.ID != curGuildBossData.InfoID)
     {
         return;
     }
     if (this.bossActor != null)
     {
         this.bossActor.Undead = false;
         this.bossActor.DamageRecount = false;
         this.bossActor.DoDamage(this.bossActor.MaxHP, null, false);
     }
     this.isBossDead = true;
     this.timeStamp = Time.time + 3f;
     this.actorMgr.LockAllActorAI();
     GameUIManager.mInstance.uiState.GuildBossKillerName = playerName;
 }
Esempio n. 32
0
 protected internal HellKeeper(MonsterInfo info) : base(info)
 {
     Direction = MirDirection.Up;
 }
Esempio n. 33
0
 public void OnBossRespawnEvent(int slot, MonsterInfo info)
 {
     WorldBossSubSystem worldBossSystem = Globals.Instance.Player.WorldBossSystem;
     this.RefreshBossItemInfo(worldBossSystem.GetBossData(slot), info, true);
 }