public Magicable(Actor actor) : base(actor) { _capacityModifiers = new ModifiedValueBoilerplate <IMagicCapacityModifier>(modifier => modifier.MagicCapacity); _generationModifiers = new ModifiedValueBoilerplate <IMagicGenerationModifier>(modifier => modifier.MagicGeneration); _generationModifiers.ModifierRecalculated += OnModifierRecalculated; _capacityModifiers.ModifierRecalculated += OnModifierRecalculated; }
public Healthable(Actor actor) : base(actor) { _capacityModifiers = new ModifiedValueBoilerplate <IHealthCapacityModifier>(modifier => modifier.HealthCapacity); _generationModifiers = new ModifiedValueBoilerplate <IHealthGenerationModifier>(modifier => modifier.HealthGeneration); _capacityModifiers.ModifierRecalculated += NotifyViewChanged; _generationModifiers.ModifierRecalculated += NotifyViewChanged; }
public Movable(Actor actor, NavMeshAgent agent, NavMeshObstacle obstacle) : base(actor) { _agent = agent; _obstacle = obstacle; MoveSpeed = new ModifiedValueBoilerplate <IMoveSpeedModifier>(modifier => modifier.MoveSpeed); TurnSpeed = new ModifiedValueBoilerplate <ITurnSpeedModifier>(modifiier => modifiier.TurnSpeed); }
public ModifiedArmor(Func <TBlockMod, FloatModifier> getBlockMod, Func <TResistMod, FloatModifier> getResistMod) { Block = new ModifiedValueBoilerplate <TBlockMod>(getBlockMod); Resistance = new ModifiedValueBoilerplate <TResistMod>(getResistMod); Block.ModifierRecalculated += OnModifierChanged; Resistance.ModifierRecalculated += OnModifierChanged; Immunity = false; }
public Attackerable(Actor actor, ITeamable teamable = default) : base(actor) { _teamable = teamable; var helper = TriggerUtility.CreateTrigger <SphereCollider>(Actor, AttackerableTrigger); _trigger = new AttackTargetTrigger <SphereCollider>(Actor, helper, _teamable); _attackCooldown = new DurationTimer(0f, true); _damage = new ModifiedValueBoilerplate <IAttackDamageModifier>(modifier => modifier.AttackDamage); _range = new ModifiedValueBoilerplate <IAttackRangeModifier>(modifier => modifier.AttackRange); _attacksPerInterval = new ModifiedValueBoilerplate <IAttacksPerIntervalModifier>(modifier => modifier.AttacksPerInterval); _interval = new ModifiedValueBoilerplate <IAttackIntervalModifier>(modifier => modifier.AttackInterval); }