Exemple #1
0
    // Default Constructor (1 Weapon, Armor, and 1 Tool) with Initial NanoBuilder
    public Hero(string name, Weapon weapon, Armor _armor, Tool tool, float maxHP, float curHP, float attk, NanoBuilder builder = null)
    {
        heroName = name;
        weapons.Add(weapon);
        armor = _armor;
        tools.Add(tool);

        heroStats = new UnitStats(maxHP, attk, armor.armorStats._curDefense, armor.armorStats._curShield);

        heroStats.curHP = curHP;

        if (builder == null)
            nanoBuilder = new NanoBuilder();
        else
            nanoBuilder = builder;
    }
Exemple #2
0
    // CHARACTER CREATION:
    // Create the Hero data class that will hold all the information of the player's Hero character
    public void CreateHero(string name = "Hiro", string weaponOne = "Kinetic Rifle", string weaponTwo = "Freeze Gun", string tool = "Mining Drill", string armor = "Vacumn Suit", float maxHP = 100f, float curHP = 100f, float attk = 2, NanoBuilder builder = null)
    {
        // Default constructor for test needs a weapon, a tool, and armor.

        theHero = new Hero(name,
                            Items_Database.Instance.GetWeaponfromID(weaponOne),
                            Items_Database.Instance.GetArmorfromID(armor),
                            Items_Database.Instance.GetToolfromID(tool),
                            maxHP,
                            curHP,
                            attk,
                            builder);

        theHero.AddWeapon(Items_Database.Instance.GetWeaponfromID(weaponTwo));

           // Debug.Log("Hero Created!");
           // Debug.Log("Hero is wielding: " + theHero.weapons[0].itemName + " armor: " + theHero.armor.itemName + " and tool: " + theHero.tools[0].itemName);
          //  Debug.Log("and " + theHero.weapons[1].itemName);

        isHeroCreated = true;
    }
 public void SaveNanoBuilder(NanoBuilder builder)
 {
     savedNanoBuilder = builder;
 }
    void Start()
    {
        // InitBluePrints();
        //BlueprintDatabase.Instance.LoadToNanoBuilder(this);

        NanoBuilder = GameMaster.Instance.theHero.nanoBuilder;

        InitBP();

           // audio_source = GetComponent<AudioSource>();

        build_controller = Build_MainController.Instance;
        build_controller.nanoBuild_handler = this;
    }
    void Start()
    {
        hero_nanoBuilder = GameMaster.Instance.theHero.nanoBuilder;

        //// Check if this is the firs time we load the Blueprint screen. If it is we need to load the Terraformer unto the Hero's blueprints map.
        //if (!hero_nanoBuilder.CheckForBlueprint(TileData.Types.terraformer))
        //{
        //    // As soon as we have access to the Hero, the first blueprint to load into it would be the Terraformer (this assumes BP database has been Initialized)
        //    hero_nanoBuilder.AddBluePrint(TileData.Types.terraformer, blueprintsMap["Terraformer"]);
        //    Debug.Log("Hero added blueprint for " + blueprintsMap["Terraformer"].buildingName);
        //}

        InitRequiredBlueprint();

        // If we are on the Inventory/Blueprint Loader scene, we should display the memory count on the Hero's nanobuilder
        if (SceneManager.GetActiveScene().buildIndex == inventoryLvlIndex)
        {
            DisplayBuilderMemory();
        }
    }