public override void DoEndOfTurnEffect(Monster p_monster) { Damage damage = new Damage(EDamageType.EARTH, (Int32)GetBuffValue(1), 1f, 1f); DamageResult item = DamageResult.Create(damage, p_monster.StaticData.MagicResistances); AttackResult attackResult = new AttackResult(); attackResult.Result = EResultType.HIT; attackResult.DamageResults.Add(item); p_monster.ApplyDamages(attackResult, m_causer); MonsterBuffDamageEntryEventArgs p_args = new MonsterBuffDamageEntryEventArgs(this, p_monster, attackResult); p_monster.BuffHandler.AddLogEntry(MonsterBuffHandler.ELogEntryPhase.ON_END_TURN, p_args); LegacyLogic.Instance.EventManager.InvokeEvent(p_monster, EEventType.MONSTER_BUFF_PERFORM, new BuffPerformedEventArgs(this, attackResult)); }
public override void DoOnCastSpellEffect(Monster p_monster) { Int32 p_damageValue = Random.Range((Int32)GetBuffValue(0), (Int32)GetBuffValue(1) + 1); Damage damage = new Damage(EDamageType.PRIMORDIAL, p_damageValue, 1f, 1f); DamageResult item = DamageResult.Create(damage, p_monster.StaticData.MagicResistances); AttackResult attackResult = new AttackResult(); attackResult.Result = EResultType.HIT; attackResult.DamageResults.Add(item); m_delayedDamage = attackResult; p_monster.BuffHandler.FlagForRemoval(this); MonsterBuffDamageEntryEventArgs p_args = new MonsterBuffDamageEntryEventArgs(this, p_monster, attackResult); p_monster.BuffHandler.AddLogEntry(MonsterBuffHandler.ELogEntryPhase.ON_CAST_SPELL, p_args); }
public override void DoOnGetDamageEffect(Monster p_monster, List <DamageResult> p_results) { foreach (DamageResult damageResult in p_results) { if (damageResult.Type == EDamageType.PHYSICAL) { Int32 p_damageValue = Random.Range((Int32)GetBuffValue(0), (Int32)GetBuffValue(1)); Damage damage = new Damage(EDamageType.DARK, p_damageValue, 1f, 1f); DamageResult item = DamageResult.Create(damage, p_monster.StaticData.MagicResistances); AttackResult attackResult = new AttackResult(); attackResult.Result = EResultType.HIT; attackResult.DamageResults.Add(item); p_monster.ChangeHP(-attackResult.DamageDone, m_causer); MonsterBuffDamageEntryEventArgs p_args = new MonsterBuffDamageEntryEventArgs(this, p_monster, attackResult); p_monster.BuffHandler.AddLogEntry(MonsterBuffHandler.ELogEntryPhase.ON_GET_DAMAGE, p_args); LegacyLogic.Instance.EventManager.InvokeEvent(p_monster, EEventType.MONSTER_BUFF_PERFORM, new BuffPerformedEventArgs(this, attackResult)); } } }
public override void DoEndOfTurnEffect(Monster p_monster) { if (p_monster.CurrentHealth == p_monster.MaxHealth) { return; } Int32 num = (Int32)GetBuffValue(0); p_monster.ChangeHP(num, m_causer); MonsterBuffDamageEntryEventArgs p_args = new MonsterBuffDamageEntryEventArgs(this, p_monster, new AttackResult { Result = EResultType.HEAL, DamageResults = { new DamageResult(EDamageType.HEAL, num, 0, 1f) } }); p_monster.BuffHandler.AddLogEntry(MonsterBuffHandler.ELogEntryPhase.ON_END_TURN, p_args); }
public override void HandleAttacks(List <Attack> p_attackList, Monster p_monster, Character p_character, Boolean p_isMagic) { if (p_monster.CurrentHealth == p_monster.MaxHealth) { return; } AbilityTriggeredEventArgs p_args = new AbilityTriggeredEventArgs(p_monster, this); Int32 num = (Int32)(p_monster.MaxHealth * (m_staticData.GetValues(m_level)[0] * 0.01f)); p_monster.ChangeHP(num, null); MonsterBuff p_buff = new MonsterBuff(20, p_monster.MagicPower); MonsterBuffDamageEntryEventArgs p_args2 = new MonsterBuffDamageEntryEventArgs(p_buff, p_monster, new AttackResult { Result = EResultType.HEAL, DamageResults = { new DamageResult(EDamageType.HEAL, num, 0, 1f) } }); p_monster.AbilityHandler.AddEntry(m_executionPhase, p_args); p_monster.AbilityHandler.AddEntry(m_executionPhase, p_args2); LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.ENTITY_ABILITY_ADDED, new AbilityEventArgs(p_monster, this)); }