Exemple #1
0
        public override GameEvent_Command ReifyStub(FloorState arena)
        {
            var user = arena.ResolveEID(this.UserEID);
            var item = user.GetComponentOfType <Component_Inventory>().FindByEid(this.ItemEID);

            return(new GameEvent_UseItem(arena.CurrentTick, Config.ONE, user, item, arena.ResolveEID(this.TargetEID)));
        }
        public override GameEvent_Command ReifyStub(FloorState floor)
        {
            // TODO: Equipped items are *not* "Whatever is held in right right arm"
            var attackerEntity = floor.ResolveEID(this.AttackerEID);
            var equippedWeapon = attackerEntity.GetComponentOfType <Component_Skeleton>()
                                 .InspectBodyPart(BodyPartLocation.RIGHT_ARM)
                                 .TryGetSubEntities(SubEntitiesSelector.WEAPON)
                                 .FirstOrDefault();

            return(new GameEvent_PrepareAttack(floor.CurrentTick, Config.ONE, attackerEntity,
                                               floor.ResolveEID(this.TargetEID), equippedWeapon, floor.FloorMap, this.SubTarget));
        }
        public override GameEvent_Command ReifyStub(FloorState floor)
        {
            var commandEntity          = floor.ResolveEID(this.CommandEID);
            var commandPosition        = commandEntity.TryGetPosition();
            var entityAtTargetPosition = floor.EntityAtPosition(commandPosition.X + (int)this.X,
                                                                commandPosition.Y + (int)this.Y);

            if (entityAtTargetPosition != null)
            {
                // TODO: Don't always bump attack to torso
                return(new CommandStub_PrepareTargetedAttack(this.CommandEID, entityAtTargetPosition.EntityID,
                                                             entityAtTargetPosition.Label, BodyPartLocation.TORSO)
                       .ReifyStub(floor));
            }
            else
            {
                return(new GameEvent_MoveSingle(floor.CurrentTick, Config.ONE, commandEntity, this.X, this.Y, floor));
            }
        }
        public override GameEvent_Command ReifyStub(FloorState floor)
        {
            var attackerEntity = floor.ResolveEID(this.AttackerEID);
            var equippedWeapon = attackerEntity.GetComponentOfType <Component_Skeleton>()
                                 .InspectBodyPart(BodyPartLocation.RIGHT_ARM)
                                 .TryGetSubEntities(SubEntitiesSelector.WEAPON)
                                 .FirstOrDefault();

            // TODO: Don't require exact square
            var attackerPosition = attackerEntity.TryGetPosition();
            var targetEntity     = floor.EntityAtPosition(attackerPosition.X + this.x, attackerPosition.Y + this.y);

            if (targetEntity != null)
            {
                return(new GameEvent_PrepareAttack(floor.CurrentTick, Config.ONE, attackerEntity, targetEntity,
                                                   equippedWeapon, floor.FloorMap, this.SubTarget));
            }
            else
            {
                return(new GameEvent_Delay(floor.CurrentTick, Config.ONE, attackerEntity));
            }
        }
Exemple #5
0
 public override GameEvent_Command ReifyStub(FloorState arena)
 {
     return(new GameEvent_ReceiveStatusEffect(arena.CurrentTick, this.APCost, arena.ResolveEID(this.TargetEID),
                                              arena.ResolveEID(this.CasterEID), this.StatusEffect));
 }
Exemple #6
0
 public override GameEvent_Command ReifyStub(FloorState arena)
 {
     return(new GameEvent_Delay(arena.CurrentTick, this.APCost, arena.ResolveEID(this.CommandEID)));
 }
Exemple #7
0
 public override GameEvent_Command ReifyStub(FloorState floor)
 {
     return(new GameEvent_Teleport(floor.CurrentTick, Config.ONE, floor.ResolveEID(this.CommandEID), this.X,
                                   this.Y, this.Z, this.DestinationFloor));
 }
 public override GameEvent_Command ReifyStub(FloorState floor)
 {
     return(new GameEvent_MoveSingle(floor.CurrentTick, Config.ONE, floor.ResolveEID(this.CommandEID), this.X,
                                     this.Y, floor));
 }