예제 #1
0
        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();
        }
예제 #2
0
        public CombatManager()
        {
            if (instance != null)
            {
                Log.Fatal("CombatManager: instance already created");
            }

            instance   = this;
            turnNumber = 0;
        }
예제 #3
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);
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
 public override void ItemClick()
 {
     (Owner.Intellect as RTSUnitAI).DoTask(new RTSUnitAI.Task(RTSUnitAI.Task.Types.PreUse), false);
     CombatManager.StartCombat(Owner.Intellect as VBUnitAI);
 }
예제 #6
0
 protected override void OnDestroy()
 {
     instance = null;
     base.OnDestroy();
 }