public void Death(Stats stats) { if(State != MobStates.Death) { Status = MobStatus.None; State = MobStates.Death; Stop(); PlayerControll.Instance.Stats.Energy += stats.Energy; Agent.enabled = false; GetComponent<SphereCollider>().enabled = false; Animator.SetTrigger("Death"); Harmable.AllHarmableObjects.Remove(this); Destroy(gameObject, 5); } }
/// <summary> /// Declare the current state of the mob as attacking. /// </summary> /// <param name="target">Gameobject that this mob will target to attack</param> protected virtual void BeginAttack(GameObject target) { currentStatus = MobStatus.Attacking; FollowTarget(target.transform); }
/// <summary> /// ライフゲージを破棄します。 /// </summary> /// <param name="status"></param> public void Remove(MobStatus status) { Destroy(_statusLifeBarMap[status].gameObject); _statusLifeBarMap.Remove(status); }
/// <summary> /// Declare the current state of the mob as Searching. /// </summary> protected virtual void BeginSearch() { searchWaitTime = 0f; currentStatus = MobStatus.Searching; }
private void Start() { _status = GetComponent <MobStatus>(); }
/// <summary> /// Declare the current state of the mob as attacking. /// </summary> /// <param name="target">Gameobject that this mob will target to attack</param> private void BeginAttack(GameObject target) { currentStatus = MobStatus.Attacking; FollowTarget(target.transform); }
/// <summary> /// Declare the current state of the mob as Searching. /// </summary> private void BeginSearch() { searchWaitTime = 0f; currentStatus = MobStatus.Searching; }
public void Cast(Mob caster) { MobStatus status = MobStatus.Null; CharacterDisease disease = CharacterDisease.Null; bool heal = false; bool banish = false; bool dispel = false; switch ((MobSkillName)this.MapleID) { case MobSkillName.WeaponAttackUp: case MobSkillName.WeaponAttackUpAreaOfEffect: case MobSkillName.WeaponAttackUpMonsterCarnival: status = MobStatus.WeaponAttackUp; break; case MobSkillName.MagicAttackUp: case MobSkillName.MagicAttackUpAreaOfEffect: case MobSkillName.MagicAttackUpMonsterCarnival: status = MobStatus.MagicAttackUp; break; case MobSkillName.WeaponDefenseUp: case MobSkillName.WeaponDefenseUpAreaOfEffect: case MobSkillName.WeaponDefenseUpMonsterCarnival: status = MobStatus.WeaponDefenseUp; break; case MobSkillName.MagicDefenseUp: case MobSkillName.MagicDefenseUpAreaOfEffect: case MobSkillName.MagicDefenseUpMonsterCarnival: status = MobStatus.MagicDefenseUp; break; case MobSkillName.HealAreaOfEffect: heal = true; break; case MobSkillName.Seal: disease = CharacterDisease.Sealed; break; case MobSkillName.Darkness: disease = CharacterDisease.Darkness; break; case MobSkillName.Weakness: disease = CharacterDisease.Weaken; break; case MobSkillName.Stun: disease = CharacterDisease.Stun; break; case MobSkillName.Curse: // TODO: Curse. break; case MobSkillName.Poison: disease = CharacterDisease.Poison; break; case MobSkillName.Slow: disease = CharacterDisease.Slow; break; case MobSkillName.Dispel: dispel = true; break; case MobSkillName.Seduce: disease = CharacterDisease.Seduce; break; case MobSkillName.SendToTown: // TODO: Send to town. break; case MobSkillName.PoisonMist: // TODO: Spawn poison mist. break; case MobSkillName.Confuse: disease = CharacterDisease.Confuse; break; case MobSkillName.Zombify: // TODO: Zombify. break; case MobSkillName.WeaponImmunity: status = MobStatus.WeaponImmunity; break; case MobSkillName.MagicImmunity: status = MobStatus.MagicImmunity; break; case MobSkillName.WeaponDamageReflect: case MobSkillName.MagicDamageReflect: case MobSkillName.AnyDamageReflect: // TODO: Reflect. break; case MobSkillName.AccuracyUpMonsterCarnival: case MobSkillName.AvoidabilityUpMonsterCarnival: case MobSkillName.SpeedUpMonsterCarnival: // TODO: Monster carnival buffs. break; case MobSkillName.Summon: foreach (int mobId in MobSkill.Summons[this.Level]) { Mob summon = new Mob(mobId); summon.Position = caster.Position; switch (mobId) { case 8500003: // Papulatus bomb (High) summon.Foothold = (short)Math.Ceiling(Application.Random.NextDouble() * 19.0); summon.Position.Y -= 590; break; case 8500004: // Papulatus bomb (Low) summon.Position.X += (short)(Application.Random.Next(1000) - 500); if (summon.Position.Y != -590) { summon.Position.Y = caster.Position.Y; } break; case 8510100: //Pianus bomb if (Math.Ceiling(Application.Random.NextDouble() * 5) == 1) { summon.Position.Y = 78; summon.Position.X = (short)(Application.Random.Next(5) + (Application.Random.Next(2) == 1 ? 180 : 0)); } else { summon.Position.X += (short)(Application.Random.Next(1000) - 500); } break; } switch (caster.Map.MapleID) { case 220080001: // Papulatus' map if (summon.Position.X < -890) { summon.Position.X = (short)(Math.Ceiling(Application.Random.NextDouble() * 150) - 890); } else if (summon.Position.X > 230) { summon.Position.X = (short)(230 - Math.Ceiling(Application.Random.NextDouble() * 150)); } break; case 230040420: // Pianus' map if (summon.Position.X < -239) { summon.Position.X = (short)(Math.Ceiling(Application.Random.NextDouble() * 150) - 239); } else if (summon.Position.X > 371) { summon.Position.X = (short)(371 - Math.Ceiling(Application.Random.NextDouble() * 150)); } break; } summon.SpawnEffect = this.SummonEffect; caster.Map.Mobs.Add(summon); } break; } foreach (Mob affectedMob in this.GetAffectedMobs(caster)) { if (heal) { affectedMob.Heal((uint)this.ParameterA, this.ParameterB); } if (status != MobStatus.Null && !affectedMob.Buffs.Contains(status)) { affectedMob.Buff(status, (short)this.ParameterA, this); } } foreach (Character affectedCharacter in this.GetAffectedCharacters(caster)) { if (dispel) { //affectedCharacter.Dispel(); } if (banish) { affectedCharacter.ChangeMap(affectedCharacter.Map.ReturnMapID); } if (disease != CharacterDisease.Null) { //affectedCharacter.Debuff(disease); } } caster.CurrentMP -= (uint)this.MpCost; if (caster.Cooldowns.ContainsKey(this)) { caster.Cooldowns[this] = DateTime.Now; } else { caster.Cooldowns.Add(this, DateTime.Now); } }
public void Cast(Mob caster) { MobStatus status = MobStatus.None; CharacterConstants.CharacterDisease disease = CharacterConstants.CharacterDisease.None; bool heal = false; //bool banish = false; bool dispel = false; switch ((MobSkillName)this.MapleID) { case MobSkillName.WeaponAttackUp: case MobSkillName.WeaponAttackUpAreaOfEffect: case MobSkillName.WeaponAttackUpMonsterCarnival: status = MobStatus.WeaponAttackUp; break; case MobSkillName.MagicAttackUp: case MobSkillName.MagicAttackUpAreaOfEffect: case MobSkillName.MagicAttackUpMonsterCarnival: status = MobStatus.MagicAttackUp; break; case MobSkillName.WeaponDefenseUp: case MobSkillName.WeaponDefenseUpAreaOfEffect: case MobSkillName.WeaponDefenseUpMonsterCarnival: status = MobStatus.WeaponDefenseUp; break; case MobSkillName.MagicDefenseUp: case MobSkillName.MagicDefenseUpAreaOfEffect: case MobSkillName.MagicDefenseUpMonsterCarnival: status = MobStatus.MagicDefenseUp; break; case MobSkillName.HealAreaOfEffect: heal = true; break; case MobSkillName.Seal: disease = CharacterConstants.CharacterDisease.Sealed; break; case MobSkillName.Darkness: disease = CharacterConstants.CharacterDisease.Darkness; break; case MobSkillName.Weakness: disease = CharacterConstants.CharacterDisease.Weaken; break; case MobSkillName.Stun: disease = CharacterConstants.CharacterDisease.Stun; break; case MobSkillName.Curse: disease = CharacterConstants.CharacterDisease.Curse; break; case MobSkillName.Poison: disease = CharacterConstants.CharacterDisease.Poison; break; case MobSkillName.Slow: disease = CharacterConstants.CharacterDisease.Slow; break; case MobSkillName.Dispel: dispel = true; break; case MobSkillName.Seduce: disease = CharacterConstants.CharacterDisease.Seduce; break; case MobSkillName.SendToTown: // TODO: Send to town. break; case MobSkillName.PoisonMist: // TODO: Spawn poison mist. break; case MobSkillName.Confuse: disease = CharacterConstants.CharacterDisease.Confuse; break; case MobSkillName.Zombify: // TODO: Zombify. break; case MobSkillName.WeaponImmunity: status = MobStatus.WeaponImmunity; break; case MobSkillName.MagicImmunity: status = MobStatus.MagicImmunity; break; case MobSkillName.WeaponDamageReflect: case MobSkillName.MagicDamageReflect: case MobSkillName.AnyDamageReflect: // TODO: Reflect. break; case MobSkillName.AccuracyUpMonsterCarnival: case MobSkillName.AvoidabilityUpMonsterCarnival: case MobSkillName.SpeedUpMonsterCarnival: // TODO: Monster carnival buffs. break; case MobSkillName.Summon: foreach (int mobId in MobSkill.Summons[this.Level]) { Mob summon = new Mob(mobId) { Position = caster.Position, SpawnEffect = this.SummonEffect }; caster.Map.Mobs.Add(summon); } break; } foreach (Mob affectedMob in this.GetAffectedMobs(caster)) { if (heal) { affectedMob.Heal((uint)this.ParameterA, this.ParameterB); } if (status != MobStatus.None && !affectedMob.Buffs.Contains(status)) { affectedMob.Buff(status, (short)this.ParameterA, this); } } foreach (Character affectedCharacter in this.GetAffectedCharacters(caster)) { if (dispel) { //affectedCharacter.Dispel(); } /* * if (banish) * { * affectedCharacter.ChangeMap(affectedCharacter.Map.ReturnMapID); * } */ if (disease != CharacterConstants.CharacterDisease.None) { using (Packet oPacket = new Packet(ServerOperationCode.TemporaryStatSet)) { oPacket .WriteLong() .WriteLong((long)disease); oPacket .WriteShort((short)this.ParameterA) .WriteShort(this.MapleID) .WriteShort(this.Level) .WriteInt(this.Duration); oPacket .WriteShort() .WriteShort(900) .WriteByte(1); affectedCharacter.Client.Send(oPacket); } //map packet. } } caster.Mana -= (uint)this.MpCost; if (caster.Cooldowns.ContainsKey(this)) { caster.Cooldowns[this] = DateTime.Now; } else { caster.Cooldowns.Add(this, DateTime.Now); } }