Пример #1
0
        protected override void OnEnterComplete(Actor self, Actor targetActor)
        {
            // Make sure the target hasn't changed while entering
            // OnEnterComplete is only called if targetActor is alive
            if (targetActor != enterActor)
            {
                return;
            }

            if (!CanEnterHut())
            {
                return;
            }

            if (enterLegacyHut != null)
            {
                enterLegacyHut.Repair(self);
            }
            else if (enterHut != null)
            {
                enterHut.Repair(enterActor, self);
            }

            Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", notification, self.Owner.Faction.InternalName);

            if (enterBehaviour == EnterBehaviour.Dispose)
            {
                self.Dispose();
            }
            else if (enterBehaviour == EnterBehaviour.Suicide)
            {
                self.Kill(self);
            }
        }
Пример #2
0
        protected override void OnInside(Actor self)
        {
            if (legacyHut != null)
            {
                if (legacyHut.BridgeDamageState == DamageState.Undamaged || legacyHut.Repairing || legacyHut.Bridge.GetHut(0) == null || legacyHut.Bridge.GetHut(1) == null)
                {
                    return;
                }

                legacyHut.Repair(self);
            }
            else if (hut != null)
            {
                if (hut.BridgeDamageState == DamageState.Undamaged || hut.Repairing)
                {
                    return;
                }

                hut.Repair(target, self);
            }

            Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", notification, self.Owner.Faction.InternalName);
        }