예제 #1
0
파일: Magicable.cs 프로젝트: ModernMAK/BoEG
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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);
 }
예제 #4
0
 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;
 }
예제 #5
0
        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);
        }