public void Initialize(BS_Combatant cmbt, MT_Team t) { _team = t; _pawn = null; _base = cmbt; IsOut = false; }
// --------------------------------------------------------------------------------------- public void Randomize(int startValue, string teamName) // --------------------------------------------------------------------------------------- { BaseColor = Rng.RandomColor(); AccentColor = new Color(1 - BaseColor.r, 1 - BaseColor.g, 1 - BaseColor.b); float amtRemaining = startValue; float perPerson = amtRemaining / (float)RoughStartNumPlayers; float amtSlopRemaining = startValue * 1.2f; int failedTries = 0; while (amtRemaining > 0 && failedTries < 20) { BS_Combatant pc = new BS_Combatant(); pc.SetTeam(this); pc.Randomize(perPerson); float value = pc.Cost; if (amtSlopRemaining - value > 0) // value isn't pushing us over the slop amt { amtRemaining -= value; amtSlopRemaining -= value; AllTeamMembers.Add(pc); } else { failedTries++; } } DisplayName = teamName; }
public MT_ActionInstance(BS_ActionDesc temp, BS_Combatant owner, int actionPoints = -1) { ActionTemplate = temp; Owner = owner; if (actionPoints < 0) { APConsumed = temp.APRequired; } }
void OnSelectionSet(SM_SelectionChangedEvent ev) { SM_Pawn pawn = ev.Get <SM_Pawn>(); if (pawn != null) { BS_Combatant comb = pawn.GameParent as BS_Combatant; if (comb != null) { SetCombatant(comb); } } }
public MT_TargetCombatantActionInstance(BS_ActionDesc temp, BS_Combatant owner, BS_Combatant target) : base(temp, owner) { TargetCombatant = target; }
public void Shutdown() { _base = null; _pawn = null; _team = null; }
public void SetCombatant(BS_Combatant cmbt) { _combatant = cmbt; _baseStats.SetPropertySet(_combatant.Properties); RefreshUI(); }