void InitDOTAbility() { _dotAbility = new AbilityBase { Caster = this }; AbilityDamageAction dealDamageAction = new AbilityDamageAction("DealDamage", this, new DamageInfo(DamageType.Physical, -10)); dealDamageAction.TargetSelector = new SelectOtherTargetSelector(this, dealDamageAction); dealDamageAction.TargetSelector.SetTargetTypes(TargettedActionTargetType.Target); AbilityThinkerModifier dotThinker = new AbilityThinkerModifier("DOT Thinker", this, 3, 0.5f) { TargetSelector = new ColliderBasedTargetSelector(this, DamageAbilityDamageDealer.InteractableCollider) }; dotThinker.TargetSelector.SetTargetTypes(TargettedActionTargetType.Target); OnThinkModifierEvent onThinkModifierEvent = new OnThinkModifierEvent(dotThinker, dotThinker); onThinkModifierEvent.TriggerActionList.Add(dealDamageAction); _dotAbility.Modifiers.Add(dotThinker); AbilityCreateThinkerAction createDOTThinkerAction = new AbilityCreateThinkerAction("DOT Thinker", this, dotThinker) { TargetSelector = new ColliderBasedTargetSelector(this, DamageAbilityDamageDealer.InteractableCollider) }; createDOTThinkerAction.TargetSelector.SetTargetTypes(TargettedActionTargetType.Target); OnCastStartedAbilityEvent onCastStartedAbilityEvent = new OnCastStartedAbilityEvent(_dotAbility, null); onCastStartedAbilityEvent.TriggerActionList.Add(createDOTThinkerAction); _dotAbility.Events.Add(onCastStartedAbilityEvent); }
void InitPoisonAbility() { _poisonAbility = new AbilityBase(); _poisonAbility.Caster = this; AbilityDamageAction damageAction = new AbilityDamageAction( "Poison Damage", this, new DamageInfo(DamageType.Physical, -10)); damageAction.TargetSelector = new SelectOtherTargetSelector(this, damageAction); AbilityThinkerModifier poisonThinker = new AbilityThinkerModifier( "Poison Thinker", this, 5, 1f); poisonThinker.TargetSelector = new SelectOtherTargetSelector(this, poisonThinker); OnThinkModifierEvent onThink = new OnThinkModifierEvent(poisonThinker, poisonThinker); onThink.TriggerActionList.Add(damageAction); _poisonAbility.Modifiers.Add(poisonThinker); AbilityCreateThinkerAction createPoisonThinkerAction = new AbilityCreateThinkerAction("Poison Thinker", this, poisonThinker); createPoisonThinkerAction.TargetSelector = new ActionEventTargetSelector(this, createPoisonThinkerAction); OnTakeDamageAbilityEvent onTakeDamage = new OnTakeDamageAbilityEvent(this, null, false); onTakeDamage.TriggerActionList.Add(createPoisonThinkerAction); _poisonAbility.Events.Add(onTakeDamage); }