Example #1
0
    //Called from PlayerMaster to init state information
    public void init(int playerNumber, int totalPlayers, Color playerColor, FillScript healthBar, Overlord o)
    {
        this.overlord     = o;
        this.healthBar    = healthBar;
        this.color        = playerColor;
        this.stats        = new EntityStats();
        this.stats.hud    = hud;
        this.hud.playerID = playerNumber;                                                                       //Allows for items to be added in hud and stuff
        this.hud.player   = this;
        overlord.resourceCore.itemSlice.gearSpawnedPlayer(this);                                                //testing gearing
        playerColor.a        = 1.0f;                                                                            //Healthbar color - Werid issues when converting from Color to Color32
        trail.material.color = playerColor;
        stats.recalculateStats();
        this.stats.health           = this.stats.maxHealth;
        healthBar.healthcolor.color = playerColor;
        this.stats.hud.updateHealthbar();
        cSlice.init(stats, this, anim, healthBar);
        checkPlayerIDs();

        //playerMesh.GetComponent<Renderer>().material.color = c;                   //Set the color. Don't delete, we will need this
        cameraSetup(totalPlayers, playerNumber);                                                                        //initialize the camera based on the count of players
        switch (playerNumber)                                                                                           //Set the gamepad
        {
        case 1: gamepad = new InputController(ControllerNumber.ONE);   break;

        case 2: gamepad = new InputController(ControllerNumber.TWO);   break;

        case 3: gamepad = new InputController(ControllerNumber.THREE); break;

        case 4: gamepad = new InputController(ControllerNumber.FOUR);  break;
        }
    }
Example #2
0
 public void init(int oid)
 {
     Debug.Log("Player " + oid + "'s Flying turret waking up!");
     ownerID = oid;                                                                                                                          //take in ownerID
     Start();
     stats        = new EntityStats();                                                                                                       //instantiate stats
     stats.attack = 10;                                                                                                                      //DEBUG NONSENSE - REMOVE ME LATER!!
     cSlice.init(stats, this, null, null);                                                                                                   //fire up combat
     cSlice.rangedAttackLength = 1.0f;
     deathTime = Time.time + lifetime;                                                                                                       //at this time, turret dies
     active    = true;                                                                                                                       //turn on Update() since we're ready
 }
Example #3
0
    public void init(Camp camp, Overlord ol)
    {
        this.camp     = camp;
        this.overlord = ol;

        stats        = new EntityStats();
        stats.attack = 10000;
        cSlice       = this.gameObject.AddComponent <CombatSlice>();
        //cSlice = new CombatSlice();
        cSlice.init(stats, this, null, null);
        active = true;
    }