コード例 #1
0
 public bool enemyCanUseItem(BattleEnemy enemy)
 {
     if (enemy.turnsLeftStatUp > -1)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
コード例 #2
0
 public void copyBattleEnemy(BattleEnemy original)
 {
     name             = original.name;
     HP               = original.HP;
     maxHP            = original.maxHP;
     str              = original.str;
     def              = original.def;
     spd              = original.spd;
     weapon1          = original.weapon1;
     weapon2          = original.weapon2;
     spriteFileName   = original.spriteFileName;
     Bleeding         = original.Bleeding;
     Stun             = original.Stun;
     turnsLeftStunned = original.turnsLeftStunned;
     statUp           = original.statUp;
     turnsLeftStatUp  = original.turnsLeftStatUp;
     statUpType       = original.statUpType;
 }
コード例 #3
0
 public BattleEnemy(BattleEnemy battleEnemy)
 {
     name             = battleEnemy.name;
     HP               = battleEnemy.HP;
     maxHP            = battleEnemy.maxHP;
     str              = battleEnemy.str;
     def              = battleEnemy.def;
     spd              = battleEnemy.spd;
     weapon1          = battleEnemy.weapon1;
     weapon2          = battleEnemy.weapon2;
     spriteFileName   = battleEnemy.spriteFileName;
     Bleeding         = battleEnemy.Bleeding;
     Stun             = battleEnemy.Stun;
     turnsLeftStunned = battleEnemy.turnsLeftStunned;
     statUp           = battleEnemy.statUp;
     turnsLeftStatUp  = battleEnemy.turnsLeftStatUp;
     statUpType       = battleEnemy.statUpType;
 }
コード例 #4
0
        public BattleEnemy(Globals.battleEnemyTypes battleEnemyType)
        {
            switch (battleEnemyType)
            {
            case Globals.battleEnemyTypes.patrolTrooperGround:

                BattleEnemy patrolTrooperGround = new BattleEnemy("Patrol Trooper", 20, 2, 1, 5, Globals.weaponTypes.nightStick, Globals.weaponTypes.hand, "Assets/enemy");
                this.copyBattleEnemy(patrolTrooperGround);
                break;

            case Globals.battleEnemyTypes.patrolTrooperJetpack:

                BattleEnemy patrolTrooperJetpack = new BattleEnemy("Jetpacked Patrol Trooper", 20, 2, 1, 5, Globals.weaponTypes.nightStick, Globals.weaponTypes.hand, "Assets/enemy");
                this.copyBattleEnemy(patrolTrooperJetpack);
                break;

            case Globals.battleEnemyTypes.riotTrooperGround:

                BattleEnemy riotTrooperGround = new BattleEnemy("Riot Trooper", 25, 3, 2, 5, Globals.weaponTypes.nightStick, Globals.weaponTypes.homeforgedPistol, "Assets/enemy");
                this.copyBattleEnemy(riotTrooperGround);
                break;

            case Globals.battleEnemyTypes.riotTrooperJetpack:

                BattleEnemy riotTrooperJetpack = new BattleEnemy("Riot Trooper", 25, 3, 2, 5, Globals.weaponTypes.nightStick, Globals.weaponTypes.homeforgedPistol, "Assets/enemy");
                this.copyBattleEnemy(riotTrooperJetpack);
                break;

            case Globals.battleEnemyTypes.ajax:

                BattleEnemy ajax = new BattleEnemy("Ajax", 35, 7, 4, 17, Globals.weaponTypes.ajaxPistol, Globals.weaponTypes.hand, "Assets/enemy");
                this.copyBattleEnemy(ajax);
                break;

            case Globals.battleEnemyTypes.barrin:

                BattleEnemy barrin = new BattleEnemy("Barrin", 36, 8, 5, 15, Globals.weaponTypes.barrinNightStick, Globals.weaponTypes.hand, "Assets/enemy");
                this.copyBattleEnemy(barrin);
                break;
            }
        }
コード例 #5
0
        //Tony: This should be run once a player/enemy starts his/her turn. DO NOT CHECK IF A WEAPON CAN BE USED WITH THIS METHOD OTHERWISE. (If a weapon is disabled, you'll decrease the number of turns it is disabled by one every time you use it. Simply get the weaponDisabled value (and remember that said value being false means it can be used.)
        public bool canUse(BattleEnemy enemy)
        {
            if (durability == 0)
            {
                if (this == enemy.weapon1)
                {
                    enemy.weapon1 = null;
                }
                else if (this == enemy.weapon2)
                {
                    enemy.weapon2 = null;
                }
                return(false);
            }
            if (weaponDisabled)
            {
                turnsLeftDisabled--;

                if (turnsLeftDisabled == 0)
                {
                    weaponHP       = maxWeaponHP;
                    weaponDisabled = false;
                }

                return(false);
            }
            else if (weaponHP <= 0)
            {
                weaponDisabled    = true;
                turnsLeftDisabled = 3;
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #6
0
 public void impacted(BattleEnemy enemy)
 {
     enemy.loseHP(damageDealt);
 }
コード例 #7
0
        private static object BattleEnemy(battleEnemyTypes battleEnemyType)
        {
            BattleEnemy battleEnemy = new BattleEnemy(battleEnemyType);

            return(battleEnemy);
        }
コード例 #8
0
        //Tony: For when an item is used by an enemy, use this method:
        public void useByEnemy(BattleEnemy enemy)
        {
            switch (this.itemType)
            {
            case itemTypes.HP_Up:
            {
                enemy.gainHP(upBy);
                return;
            }

            case itemTypes.Food:
            {
                enemy.gainHP(upBy);
                return;
            }

            case itemTypes.RandomStatUp:
            {
                Random i = new Random(3);
                if (i.ToString() == "0")
                {
                    enemy.tempStatIncrease(turns, upBy, i.ToString());
                    return;
                }
                else if (i.ToString() == "1")
                {
                    enemy.tempStatIncrease(turns, upBy, i.ToString());
                    return;
                }
                else if (i.ToString() == "2")
                {
                    enemy.tempStatIncrease(turns, upBy, i.ToString());
                    return;
                }
                else
                {
                    return;
                }
            }

            case itemTypes.StrUp:
            {
                enemy.tempStatIncrease(turns, upBy, "0");
                return;
            }

            case itemTypes.SpdUp:
            {
                enemy.tempStatIncrease(turns, upBy, "1");
                return;
            }

            case itemTypes.DefUp:
            {
                enemy.tempStatIncrease(turns, upBy, "2");
                return;
            }

            default:
            {
                enemy.gainHP(upBy);
                return;
            }
            }
        }
コード例 #9
0
 public void fell(BattleEnemy enemy)
 {
     enemy.loseHP(damageDealt);
     enemy.Stun = true;
 }