protected override void TickTasks() { if (!OutsideCombatOrActive()) { return; } switch (CurrentTask.Type) { case Task.Types.Attack: case Task.Types.BreakableAttack: //enter combat if i am attacking someone if (!CombatManager.IsEnabled) { CombatManager.StartCombat(this); } break; case Task.Types.Heal: //apply the healing thing DoNextTask(); break; } base.TickTasks(); }
public CombatManager() { if (instance != null) { Log.Fatal("CombatManager: instance already created"); } instance = this; turnNumber = 0; }
public static void StartCombat(VBUnitAI starter) { if (CombatManager.Instance != null) { return; } CombatManager i = (CombatManager)Entities.Instance.Create("CombatManager", Map.Instance); i.PostCreate(); i.CreateCombatantList(starter); }
public override void ItemClick() { switch (GetCurActionMode().Command) { case "reload": TryReload(); break; case "attack": (Owner.Intellect as RTSUnitAI).DoTask(new RTSUnitAI.Task(RTSUnitAI.Task.Types.PreUse), false); CombatManager.StartCombat(Owner.Intellect as VBUnitAI); break; default: base.ItemClick(); break; } }
public override void ItemClick() { (Owner.Intellect as RTSUnitAI).DoTask(new RTSUnitAI.Task(RTSUnitAI.Task.Types.PreUse), false); CombatManager.StartCombat(Owner.Intellect as VBUnitAI); }
protected override void OnDestroy() { instance = null; base.OnDestroy(); }