Exemple #1
0
        protected override void Tick(Actor self)
        {
            if (Info.AimSequence != null)
            {
                sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence;
            }

            var currentAmmo = ammoPool.GetAmmoCount();

            if (reloadStages < 0)
            {
                ammoSuffix = currentAmmo.ToString();
            }
            if (reloadStages >= 0)
            {
                ammoSuffix = (currentAmmo * reloadStages / ammoPool.Info.Ammo).ToString();
            }

            var newSequence = NormalizeSequence(self, sequence + ammoSuffix);

            if (DefaultAnimation.CurrentSequence.Name != newSequence)
            {
                DefaultAnimation.ReplaceAnim(newSequence);
            }
        }
Exemple #2
0
        void HunterDecisions(Actor self)
        {
            whatAmmo = ammoPool.GetAmmoCount(); // how many loot do we have stored

            if ((lodge == null || lodge.IsDead || !lodge.IsInWorld) && self.IsInWorld && !self.IsDead)
            {
                // first, find a new home when our old got destroyed
                FindALodge();
            }
            else if (whatAmmo > 0 && self.IsInWorld && !self.IsDead)
            {
                // if we got loot stored let us deliver first
                Move(self, lodge);
                Attack(self, lodge);
            }
            else if (DeerLoot != null && !DeerLoot.IsDead && DeerLoot.IsInWorld && self.IsInWorld && !self.IsDead)
            {
                // do we have a shot deer somewhere and need to gather from it?
                Move(self, DeerLoot);
                Attack(self, DeerLoot);
            }
            else if (nextLootTarget != null && !nextLootTarget.IsDead && nextLootTarget.IsInWorld && self.IsInWorld && !self.IsDead)
            {
                // is there a dead dee somehwere that belongs to noone we can loot?
                Move(self, nextLootTarget);
                Attack(self, nextLootTarget);
            }
            else if (deerHunt != null && !deerHunt.IsDead && deerHunt.IsInWorld && self.IsInWorld && !self.IsDead)
            {
                // lets find the deer we already have reserved
                Move(self, deerHunt);
                Attack(self, deerHunt);
            }
            else if (nextHunttarget != null && !nextHunttarget.IsDead && nextHunttarget.IsInWorld && self.IsInWorld && !self.IsDead)
            {
                // lets find a fresh deer noone has reserved yet
                Move(self, nextHunttarget);
                Attack(self, nextHunttarget);
            }
            else if (self.IsInWorld && !self.IsDead)
            {
                MovePlusRandomVector(self, lodge);
                if (DeerLoot == null || (DeerLoot != null && (DeerLoot.IsDead || !DeerLoot.IsInWorld)))
                {
                    nextLootTarget = FindLootableDeer();
                }
                if (deerHunt == null || (deerHunt != null && (deerHunt.IsDead || !deerHunt.IsInWorld)))
                {
                    nextHunttarget = FindhuntableDeer();
                }
            }
        }
Exemple #3
0
 public int GetAmmoCount()
 {
     return(ammoPool.GetAmmoCount());
 }
Exemple #4
0
 // Set homeLodge when created
 void INotifyCreated.Created(Actor self)
 {
     ammoPool = self.TraitsImplementing <AmmoPool>().FirstOrDefault(la => la.Info.Name == "Food");
     whatAmmo = ammoPool.GetAmmoCount();
 }