Beispiel #1
0
    // ADD SURVIVOR CLASS: this is called when the Survivor is spawned by the player
    void AddSurvivorClass(SurvivorClass survivorClass)
    {
        switch (survivorClass)
        {
        case SurvivorClass.farmer:
            gameObject.AddComponent <Farmer>();
            mySurvivorClass = SurvivorClass.farmer;
            // change name
            name            = name + " the " + mySurvivorClass;
            gameObject.name = name;
            break;

        case SurvivorClass.soldier:
            gameObject.AddComponent <Soldier>();
            mySurvivorClass = SurvivorClass.soldier;
            // change name
            name            = name + " the " + mySurvivorClass;
            gameObject.name = name;
            break;

        case SurvivorClass.scientist:
            gameObject.AddComponent <Scientist>();
            mySurvivorClass = SurvivorClass.scientist;
            // change name
            name            = name + " the " + mySurvivorClass;
            gameObject.name = name;
            break;

        default:
            print("This surivor ain't got no class!");
            break;
        }
    }
 public Survivor_Data(string name, Sprite sprite, float mood, SurvivorClass sClass, int id)
 {
     myName   = name;
     mySprite = sprite;
     myMood   = mood;
     myClass  = sClass;
     myID     = id;
 }
Beispiel #3
0
    public void ForcedStart(string sname, Sprite ssprite, float smood, SurvivorClass sClass, int myID)
    {
        name            = sname;
        mySprite        = ssprite;
        mood            = smood;
        mySurvivorClass = sClass;
        partOfTown      = true;
        // add the class script to this survivor gameobject
//		AddSurvivorClass (mySurvivorClass);
        id = myID;
    }
Beispiel #4
0
 void initializeObject()
 {
     Weapons[0] = new WeaponClass("Magnum", weapons[0], 40, .75f, 8, 5);
     Weapons[1] = new WeaponClass("c_Riffle", weapons[1], 30, .75f, 6, 125);
     Weapons[2] = new WeaponClass("S_machinegun", weapons[2], 30, .5f, 12, 150);
     Weapons[3] = new WeaponClass("Shotgun", weapons[3], 40, 1.5f, 6, 20);
     Weapons[4] = new WeaponClass("Bazooka", weapons[4], 30, 2, 10, 100);
     Weapons[5] = new WeaponClass("GranadeLauncher", weapons[5], 50, 2, 5, 30);
     Weapons[6] = new WeaponClass("AcidBullet", weapons[6], 30, 1.5f, 5, 100);
     survivor   = new SurvivorClass("Mike", Weapons[0], survivorGameObject, 100.0f, movementSpeed);
     survivor.getSurvivorWeapon().ActivateWeapon();
 }