Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.43 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class Main : MonoBehaviour {
  7.  
  8.     public Text displayText = null;
  9.     public bool statsBeingDisplayed = false;
  10.  
  11.  
  12.     Creature.Hero hero = new Creature.Hero("Captain Basharat Wellington", 60, "silver-chased tulwar", 15, 100, 0);
  13.     Creature foe = new Creature("Test Goblin", 30, "poo-covered stick", 5, 35);
  14.  
  15.     void Awake () {
  16.         displayText.text = null;
  17.         }
  18.  
  19.     // Use this for initialization
  20.     void Start () {
  21.  
  22.         Creature foe = new Creature("Test Goblin", 30, "poo-covered stick", 5, 35);
  23.  
  24.         Debug.Log("This line runs BEFORE I try to run SpawnEnemy()");
  25.         SpawnEnemy();
  26.         Debug.Log("This line runs AFTER I try to run SpawnEnemy()");
  27.  
  28.         displayText.text = hero.getName () + " has a Combat Power of " + hero.getCombatPower () + " and " +
  29.         "<color=#00ff00ff>" + hero.getCurrentHealth () + "/" + hero.getMaxHealth () + "</color>" + " health.\n\n";
  30.  
  31.         displayText.text += hero.getName () + "'s " + hero.getWeaponName () + " will deal " + "<b><color=red>" + hero.getWeaponDamage () + "</color></b>" + " damage on a successful strike.\n";
  32.         displayText.text += "A critical hit from the weapon will deal " + "<b><color=red>" + 2 * hero.getWeaponDamage () + "</color></b>" + " damage.\n\n";
  33.  
  34.         displayText.text += "* * * * * * * * * *\n\n";
  35.  
  36.         displayText.text += foe.getName () + " has a Combat Power of " + foe.getCombatPower () + " and " +
  37.             "<color=#00ff00ff>" + foe.getCurrentHealth () + "/" + foe.getMaxHealth () + "</color>" + " health.\n\n";
  38.  
  39.         displayText.text += foe.getName () + "'s " + foe.getWeaponName () + " will deal " + "<b><color=red>" + foe.getWeaponDamage () + "</color></b>" + " damage on a successful strike.\n";
  40.         displayText.text += "A critical hit from the weapon will deal " + "<b><color=red>" + 2 * foe.getWeaponDamage () + "</color></b>" + " damage.\n\n";
  41.  
  42.         }
  43.    
  44.     // Update is called once per frame
  45.     void Update () {
  46.         // Core combat loop:
  47.             // spawn enemy -> announce stats -> combat rounds ->
  48.                 // (victory -> levelup -> spawn enemy)
  49.                     // OR
  50.                 // (defeat -> housekeeping -> restart/quit)
  51.         }
  52.  
  53.     public void SpawnEnemy () {
  54.         int EnemyPicker = Random.Range(1,10);
  55.             if (EnemyPicker == 1) {Creature foe = new Creature("Animus Mold", Random.Range(15,26), "moldy bodyslam", 2, 30);}
  56.             if (EnemyPicker == 2) {Creature foe = new Creature("Leering Svartælf", Random.Range(15,26), "jagged glassine spear", 2, 30);}
  57.             if (EnemyPicker == 3) {Creature foe = new Creature("Escaped Sporehound", Random.Range(15,26), "saw-toothed gills", 5, 35);}
  58.             if (EnemyPicker == 4) {Creature foe = new Creature("Knocker Clan Sapper", Random.Range(35,46), "rocksalt blunderbuss", 5, 50);}
  59.             if (EnemyPicker == 5) {Creature foe = new Creature("Conquerer Legion Chainmaster", Random.Range(35,46), "barbed bronze scourge", 10, 50);}
  60.             if (EnemyPicker == 6) {Creature foe = new Creature("Bog Priest", Random.Range(35,46), "charmed and blackened claws", 10, 50);}
  61.             if (EnemyPicker == 7) {Creature foe = new Creature("Frothing Jotunkin", Random.Range(55,65), "etched iron mallet", 25, 70);}
  62.             if (EnemyPicker == 8) {Creature foe = new Creature("Seething Rune-Slave", Random.Range(55,65), "crushing grasp", 25, 70);}
  63.             if (EnemyPicker == 9) {Creature foe = new Creature("Serpent-Priest Yddremel The Devoted", Random.Range(55,65), "crashing ophidian spellcraft", 45, 70);}
  64.         //Debug.Log("SpawnEnemy has selected " + foe.getName());
  65.         }
  66.  
  67.  
  68.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement