Пример #1
0
        protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
        {
            L0753_B_DoNotTriggerSensor = false;//Doesnt matter
            if (theron.Hand == null)
            {
                if ((theron.Hand = Storage) == null)
                {
                    return(false);
                }

                Storage = null;
            }
            else
            {
                if ((theron.Hand?.FactoryBase != Data) || Storage != null)
                {
                    return(false);
                }

                Storage     = theron.Hand;
                theron.Hand = null;
            }

            TriggerLocalEffect(theron, actuator, true); /* This will cause a rotation of the sensors at the specified cell on the specified square after all sensors have been processed */
            if ((Effect == SensorEffect.C03_EFFECT_HOLD) && theron.Hand != null)
            {
                L0753_B_DoNotTriggerSensor = true;
            }
            else
            {
                L0753_B_DoNotTriggerSensor = false;
            }
            return(true);
        }
Пример #2
0
 protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
 {
     L0753_B_DoNotTriggerSensor = false;
     if (Effect == SensorEffect.C03_EFFECT_HOLD)
     {
         return(false);
     }
     return(true);
 }
Пример #3
0
 protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
 {
     L0753_B_DoNotTriggerSensor = ((Data == theron.Hand?.FactoryBase) == RevertEffect);
     if (!L0753_B_DoNotTriggerSensor)
     {
         theron.Hand = null;
     }
     return(true);;
 }
Пример #4
0
        public async Task <IActuatorX> ParseActuatorX(IEnumerable <ActuatorItemData> data, List <IGrabableItem> items, Point pos)
        {
            var sensors = await Task.WhenAll(data
                                             .Where(x => x.ActuatorType != 5 && x.ActuatorType != 6)
                                             .Select(async x => await ParseSensor(x, items, pos)));

            var res = new WallActuator(sensors);

            res.Renderer = builder.Factories.RenderersSource.GetWallActuatorRenderer(res);
            return(res);
        }
Пример #5
0
        public override bool TryTrigger(ILeader theron, WallActuator actuator, bool isLast)
        {
            if (!Empty)
            {
                GameConsole.Instance?.RunCommand(new ChampionCommand {
                    Actuator = this
                });
                return(true);
            }

            return(base.TryTrigger(theron, actuator, isLast));
        }
Пример #6
0
        protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
        {
            if (!base.TryInteract(theron, actuator, isLast, out L0753_B_DoNotTriggerSensor))
                return false;

            if (!L0753_B_DoNotTriggerSensor)
            {
                if (actuator.Sensors.Count == 1)
                    return true;

                actuator.Sensors.Remove(this);
            }
            return true;
        }
Пример #7
0
        protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
        {
            if (!base.TryInteract(theron, actuator, isLast, out L0753_B_DoNotTriggerSensor))
            {
                return(false);
            }
            ;

            if (!L0753_B_DoNotTriggerSensor)
            {
                TriggerLocalEffect(theron, actuator, true); /* This will cause a rotation of the sensors at the specified cell on the specified square after all sensors have been processed */
            }
            return(true);
        }
Пример #8
0
        protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
        {
            L0753_B_DoNotTriggerSensor = false;//Doesnt matter
            if (!isLast)
            {
                return(false);
            }

            L0753_B_DoNotTriggerSensor = theron.Hand != null;
            if (!L0753_B_DoNotTriggerSensor)
            {
                TriggerLocalEffect(theron, actuator, true); /* This will cause a rotation of the sensors at the specified cell on the specified square after all sensors have been processed */
                theron.Hand = Data.CreateItem();
            }
            return(true);
        }
Пример #9
0
        protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
        {
            L0753_B_DoNotTriggerSensor = false; //Doesnt matter
            if (!isLast)
            {                                   /* If the sensor is not the last one of its type on the cell */
                return(false);
            }
            //F162_afzz_DUNGEON_GetSquareFirstObject(); //TODO is it possible to put item from one side of the wall and take it from antoher ?
            if ((theron.Hand?.FactoryBase != Data) || (Storage == null))
            {
                return(false);
            }

            var handItem = theron.Hand;

            theron.Hand = Storage;
            Storage     = handItem;
            L0753_B_DoNotTriggerSensor = false;
            return(true);
        }
Пример #10
0
        public virtual bool TryTrigger(ILeader theron, WallActuator actuator, bool isLast)
        {
            bool notTriggered;

            if (Disabled)
            {
                return(false);
            }

            if (!TryInteract(theron, actuator, isLast, out notTriggered))
            {
                return(false);
            }

            var usedEffect = Effect;

            if (usedEffect == SensorEffect.C03_EFFECT_HOLD)
            {
                usedEffect   = notTriggered ? SensorEffect.C01_EFFECT_CLEAR : SensorEffect.C00_EFFECT_SET;
                notTriggered = false;
            }

            if (!notTriggered)
            {
                if (Audible)
                {
                    //TODO play audio
                    //F064_aadz_SOUND_RequestPlay_COPYPROTECTIOND(C01_SOUND_SWITCH, G306_i_PartyMapX, G307_i_PartyMapY, C01_MODE_PLAY_IF_PRIORITIZED);
                }

                if (OnceOnly)
                {
                    Disabled = true;
                }

                TriggerEffect(theron, actuator, usedEffect);
            }

            return(!notTriggered);
        }
Пример #11
0
 protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
 {
     throw new NotImplementedException();
 }
Пример #12
0
 protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
 {
     L0753_B_DoNotTriggerSensor = ((theron.Hand == null) != RevertEffect);
     return(true);
 }
Пример #13
0
 protected abstract bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor);
Пример #14
0
 protected override bool TryInteract(ILeader theron, WallActuator actuator, bool isLast, out bool L0753_B_DoNotTriggerSensor)
 {
     L0753_B_DoNotTriggerSensor = !Graphics.Items.Any();
     return(true);
 }
Пример #15
0
 public virtual IRenderer GetWallActuatorRenderer(WallActuator res)
 {
     return(new WallActuatorRenderer(res));
 }