Exemple #1
0
 public void Evacuate()
 {
     MDebug.Log("^unit EVAC");
     if (!GetOwner().Evacuate())
     {
         ToastNotification.SetToastMessage2("Must be in Evacuation zone");
     }
 }
Exemple #2
0
 public override bool CanExecAction(bool b)
 {
     if (GetLootableTiles().Count == 0)
     {
         if (b)
         {
             ToastNotification.SetToastMessage2("No Loot Nearby");
         }
         return(false);
     }
     return(base.CanExecAction(b));
 }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Alpha1))
        {
            ToastNotification.SetToastMessage1("TOAST  111111!!!!");
        }

        if (Input.GetKey(KeyCode.Alpha2))
        {
            ToastNotification.SetToastMessage2("TOAST 22222!!!!");
        }
    }
Exemple #4
0
    public static bool AddToSquad(Unlockable <TieredUnit> conf)
    {
        if (conf.IsUnlocked() && !Instance.selected_units.Contains(conf.Item) && Instance.selected_units.Count < Instance.GetMaxSquadsize())
        {
            MDebug.Log("ADDING " + conf.Item.Tiers[0].Config.ID);
            Instance.selected_units.Add(conf.Item);
            Instance.OnSelectedUpdate.AttemptCall(Instance.selected_units);
            return(true);
        }
        SoundManager.PlayAtSourceTag("SoundSFXSource", "sfx_" + SoundManager.Presets.error);
        ToastNotification.SetToastMessage2("Squad is Full");

        return(false);
    }
Exemple #5
0
 public bool HasRequirements(bool displayToast)
 {
     foreach (StatInfo s in GetRequirements())
     {
         if (Owner.Stats.GetStatAmount(s.StatType) < s.Value)
         {
             if (displayToast)
             {
                 MDebug.Log("^abilityNot enough  " + UnitStats.StatToString(s.StatType));
                 ToastNotification.SetToastMessage2("Not enough " + UnitStats.StatToString(s.StatType));
             }
             return(false);
         }
     }
     return(true);
 }
Exemple #6
0
    public void OnTileSelect(Tile selected_tile)
    {
        if (!GetLootableTiles().Contains(selected_tile))
        {
            ToastNotification.SetToastMessage2("No Loot on this Tile");
            return;
        }

        Tile_Loot loot = selected_tile.GetComponent <Tile_Loot>();

        if (loot.GetLootableAmount(Owner) == 0)
        {
            ToastNotification.SetToastMessage2("Unit has no space for " + loot.GetLootableAmount(Owner) + "" + LootBalance.GetPlayerFacingString(loot.GetLootType()) + " ");
            return;
        }


        AttemptAction(selected_tile);
    }
Exemple #7
0
    public virtual bool CanExecAction(bool displayToast)
    {
        if (!Owner.Actions.HasAP(AP_Cost))
        {
            if (displayToast)
            {
                ToastNotification.SetToastMessage2("Not enough AP");
            }
            return(false);
        }
        if (!HasRequirements(displayToast))
        {
            return(false);
        }
        if (ActionInProgress)
        {
            if (displayToast)
            {
                ToastNotification.SetToastMessage2("Other Action in Progress");
            }
            return(false);
        }
        if (!ChargeController.HasCharges())
        {
            if (displayToast)
            {
                ToastNotification.SetToastMessage2("Not Enough Charges");
            }
            return(false);
        }

        if (BlockedByCamp())
        {
            if (displayToast)
            {
                ToastNotification.SetToastMessage2("Can not use in Camp");
            }
            return(false);
        }

        return(true);
    }