public override float GetHitByMagic(Spell taken_spell)
    {
        float dmg = base.GetHitByMagic(taken_spell);

        Health -= dmg;
        base.ShowText("-" + dmg, Color.black, 0);
        BattleLog.GetInstance().AddMessage("[Turn " + GameTools.GI.NumberOfTurnsUntilWin + "] " + name + " took " + dmg + " damage.");
        IsAggroed = true;
        GameTools.Player.DamageDealt += dmg;
        return(dmg);
    }
    void actionMenuExit()
    {
        //cleanup menu
        GameStart = false;
        GuiManager.IsStillMenu = false;

        turn_manager = new GameInstance(player, Base, ModeOffset);
        BattleLog.GetInstance().Restart();
        GameTools.GameCamera.MoveToCenter();
        Debug.Log("actionMenuExit");
        PlayerStartHP = GameTools.Player.Health;
    }
    public override float GetHitByMagic(Spell taken_spell)
    {
        float dmg = base.GetHitByMagic(taken_spell);

        if (BufferedSpells.Contains(taken_spell))
        {
            return(0.0f);
        }
        Health -= dmg;
        base.ShowText("-" + dmg + " base hp", Color.red, 2);
        BattleLog.GetInstance().AddMessage("[Turn " + GameTools.GI.NumberOfTurnsUntilWin + "] " + name + " took " + dmg + " damage.");
        BufferedSpells.Add(taken_spell);
        return(dmg);
    }
Ejemplo n.º 4
0
    public override float GetHitByMagic(Spell taken_spell)
    {
        float dmg = base.GetHitByMagic(taken_spell);

        if (GameTools.Base.IsWithinBase(Map_position_x, Map_position_y))
        {
            GameTools.Base.GetHitByMagic(taken_spell);
        }
        else
        {
            Health -= dmg;
            base.ShowText("-" + dmg + "Player HP", Color.red, 0);
            BattleLog.GetInstance().AddMessage("[Turn " + GameTools.GI.NumberOfTurnsUntilWin + "] " + name + " took " + dmg + " damage.");
        }
        return(dmg);
    }
    void actionWinExit()
    {
        //Cleanup menu
        CleanTools.GetInstance().CleanRemoveLevel();

        //create new game instance
        float change_diff = (PlayerEndHP - PlayerStartHP) / PlayerStartHP * 10;

        change_diff += NumberOfWins;
        turn_manager = new GameInstance(player, Base, (int)change_diff);

        GoNextLevel = false;
        player.ReloadSpell();
        BattleLog.GetInstance().Restart();
        GameTools.GameCamera.MoveToCenter();
        PlayerStartHP = GameTools.Player.Health;
        Debug.Log("actionWinExit");
    }
    void OnGUI()
    {
        if (!GuiManager.IsShowBattleLog)
        {
            return;
        }
        //Dark box that is the same dimensions as battle log so that battlelog has dark background.
        GUI.Box(new Rect(0, Screen.height * 0.8f, Screen.width * 0.3f, Screen.height * 0.20f), "");
        string[] log = BattleLog.GetInstance().Log.ToArray();
        scrollPos = GUI.BeginScrollView(new Rect(0, Screen.height * 0.8f, Screen.width * 0.3f, Screen.height * 0.20f), scrollPos, new Rect(0, 0, Screen.width * 0.3f - 25, 400));

        for (int i = 0; i < log.Length; i++)
        {
            GUILayout.Label(log[i]);
        }

        GUI.EndScrollView();
    }
Ejemplo n.º 7
0
    public virtual void Prelogic_tick()
    {
        float dmg = 0.0f;

        //populate all the statuses
        status_tick();
        // Status modifier (poison)
        for (int i = 0; i < TickedStatus[(int)StatusType.Poison].Count; i++)
        {
            if (TickedStatus[(int)StatusType.Poison][i].Status != StatusType.Poison)
            {
                Debug.LogError("Poison tick error");
            }
            dmg += TickedStatus[(int)StatusType.Poison][i].Power;
            BattleLog.GetInstance().AddMessage("[Turn " + GameTools.GI.NumberOfTurnsUntilWin + "] " + name + " poisoned for " + dmg + " damage.");
            ShowText("Poisoned " + dmg, Color.green, i - 2);
        }
        EnsnareImmunity--;
        Health -= dmg;
    }