public bool SelectAction(byte ActionNumber) { if (ActionNumber < 6) { if (ActiveCreature.GetActionUsage(ActionNumber) == 0 || ActiveCreature.GetKin(ActionNumber) > ActiveCreature.Kin) { return(false); } ActiveCreature.DepleteActionUsage(ActionNumber); } SelectedActionNumber = ActionNumber; SelectedAction = ActiveCreature.GetAction(ActionNumber); if (OldAction == null) { actionCombo = 1; } else { if (OldAction != SelectedAction) { actionCombo = 1.5f; } else { actionCombo = 1; } } OldAction = SelectedAction; if (SelectedMovement != MovementCategory.NULL) { Ready = true; } return(true); }
public ActionResolution(BattleEngine Battle, Player User, Player Opponent) { this.Battle = Battle; this.User = User; this.Opponent = Opponent; Action = User.SelectedAction; }
//--Creature_instance.mColour; //--Creature_instance.mSprite; //--Creature_instance.mLevel; //--Creature_instance.mAncient; public CreatureInstance(Creature BaseCreature) { //AllCreatures temp = new AllCreatures(); CreatureType = temp.GetCreature(0); CreatureType = BaseCreature; Nickname = CreatureType.Name; // AllActions temp2 = new AllActions(); for (byte i = 0; i < 6; i++) { if ((BaseCreature.ID - 1) * 6 <= 50) { Actions[i] = temp2.GetAction((short)(i + (BaseCreature.ID - 1) * 6)); } else { Actions[i] = temp2.GetAction(1); } } Actions[6] = new CreatureAction( "Attack", //NAME CreatureType.Elements[0], ActionCategory.PHYSICAL, 50, //SPEED 0, //PRIORITY MODIFIER 30, //POWER 255, //USAGE 0, //MANA null ); Actions[7] = new CreatureAction( "Switch", //NAME CreatureType.Elements[0], ActionCategory.DEFENSIVE, 50, //SPEED -3, //PRIORITY MODIFIER 0, //POWER 255, //USAGE 0, //MANA new BattleEffect( 10, //PRIORITY 0, //LIFESPAN new byte[1] { 9 }, //PLACEMENT new EffectScript[1] { new EffectScript(EffectTrigger.AFTER_ACTION, 50, //SPEED new byte[1] { 0x18 }) } ) ); Actions[7].IsSwitch = true; // for (byte i = 0; i < 6; i++) { ActionAmountUsed[i] = Actions[i].Usage; //ActionAmountUsed[i] = Actions[i].Usage; NEED TO SET THIS UP STILL } foreach (CreatureStats Stat in Enum.GetValues(typeof(CreatureStats))) { SetSkillPoints(Stat, 1); CalculateStat(Stat); } for (byte i = 0; i < 12; i++) { hasCondition[i] = false; } Health = GetTotalStat(CreatureStats.HEALTH); Kin = (short)Math.Floor(1.0 * GetTotalStat(CreatureStats.KIN) / 6); }