private static void decide_nextAction_default(BattleResolutionStep p_battle, BattleEntity p_actingEntity, AttackDefinition p_attack) { BattleEntity l_targettedEntity = null; switch (p_actingEntity.Team) { case BattleEntity_Team.PLAYER: { l_targettedEntity = BattleDecision.Utils.find_battleEntity_ofTeam_random(p_battle, BattleEntity_Team.FOE); } break; case BattleEntity_Team.FOE: { l_targettedEntity = BattleDecision.Utils.find_battleEntity_ofTeam_random(p_battle, BattleEntity_Team.PLAYER); } break; } if (l_targettedEntity != null) { BQE_Attack l_attackEvent = new BQE_Attack { Attack = p_attack, Source = p_actingEntity, Target = l_targettedEntity }; Battle_Singletons._battleResolutionStep.push_attack_event(p_actingEntity, l_attackEvent); } }
public static BattleEntityPlayerSelection alloc(BattleResolutionStep p_battleResolution) { BattleEntityPlayerSelection l_battleActionSelection = new BattleEntityPlayerSelection(); l_battleActionSelection.BattleResolution = p_battleResolution; l_battleActionSelection.PlayerControlledEntity_WaitingForInput = new List <BattleEntity>(); l_battleActionSelection.PlayerControlledEntity_ExecutingAction = new List <BattleEntity>(); return(l_battleActionSelection); }
public static BattleEntityTargetSelection alloc(BattleResolutionStep p_battleResolutionStep) { BattleEntityTargetSelection l_targetSelection = new BattleEntityTargetSelection() { BattleResolutionStep = p_battleResolutionStep }; l_targetSelection.CurrentlySelectedEntity_BattleIndex = CurrentlySelectedEntity_BattleIndex_None; return(l_targetSelection); }
public void Initialize(ATB_UIComponent p_atb_line_prefab, BattleResolutionStep p_battle) { this.ATB_Lines = new List <ATB_UIComponent>(); this.ATB_Bars_Background_GO = GameObject.FindGameObjectWithTag(Tags.ATB_Bars_Background); this.ATB_Line_Prefab = p_atb_line_prefab; for (int i = 0; i < p_battle.BattleEntities.Count; i++) { ATB_UIComponent l_atb_line = GameObject.Instantiate(this.ATB_Line_Prefab, this.ATB_Bars_Background_GO.transform); RectTransform l_transform = (RectTransform)l_atb_line.transform; l_transform.anchoredPosition = new Vector2(l_transform.anchoredPosition.x, -5 - (i * l_transform.sizeDelta.y)); l_atb_line.Initialize(p_battle.BattleEntities[i]); this.ATB_Lines.Add(l_atb_line); } }
public static BattleResolutionStep Alloc() { BattleResolutionStep l_resolution = new BattleResolutionStep(); l_resolution.BattleEntities = new List <BattleEntity>(); l_resolution.DeadBattleEntities = new List <BattleEntity>(); l_resolution.ATB_Locked = false; l_resolution.BattleQueueEvents = new Queue <BattleQueueEvent>(); l_resolution.DamageEvents = new List <BaseDamageStep>(); l_resolution.Out_DamageApplied_Events = new List <BQEOut_FinalDamageApplied>(); l_resolution.Out_Death_Events = new List <BattleEntity>(); l_resolution.Out_CompletedBattlequeue_Events = new List <BattleQueueEvent>(); return(l_resolution); }
public static void decide_nextAction(BattleResolutionStep p_battle, BattleEntity p_actingEntity) { BattleEntityComponent l_actingEntityComponent = BattleEntityComponent_Container.ComponentsByHandle[p_actingEntity]; switch (p_actingEntity.Type) { case BattleEntity_Type.SOLIDER_MACHINEGUN_0: decide_nextAction_default(p_battle, p_actingEntity, ((SOLIDER_MACHINEGUN_0_conf)l_actingEntityComponent.BattleEntityConfiguration).DefaultAttack.AttackDefinition); break; default: //TODO -> Introducing an attack of type NONE that does nothing but reset the ATB value of the Entity. //TODO -> This is just for testing purpose break; } }
public static BattleEntity find_battleEntity_ofTeam_random(BattleResolutionStep p_battle, BattleEntity_Team p_team) { using (UnsafeList <int> l_targettableEntities = new UnsafeList <int>(0, Unity.Collections.Allocator.Temp)) { for (int i = 0; i < p_battle.BattleEntities.Count; i++) { if (p_battle.BattleEntities[i].Team == p_team) { l_targettableEntities.Add(i); } } if (l_targettableEntities.Length > 0) { return(p_battle.BattleEntities[l_targettableEntities[Random.Range(0, l_targettableEntities.Length)]]); } } return(null); }
public static void Alloc() { _battleResolutionStep = BattleResolutionStep.Alloc(); _battleActionSelection = BattleEntityPlayerSelection.alloc(_battleResolutionStep); _battleTargetSelection = BattleEntityTargetSelection.alloc(_battleResolutionStep); }