示例#1
0
    // Creates an NPCInfo object with randomised statistics.
    public NPCInfo CreateNPCWithRandomizedStats()
    {
        NPCStats      randomStats = GetRandomStats();
        NPCAttributes randomNPC   = SelectRandomNPC(
            FemaleCount++ > NumberOfFemales
            ? NPCAttributes.Gender.MALE
            : NPCAttributes.Gender.FEMALE
            );

        NPCInfo npc = new NPCInfo()
        {
            Attributes = randomNPC,
            Stats      = GetRandomStats()
        };

        // Here we remove the npc from the available ones and stick it into
        // the temporary pool for hiring from.
        Npcs.Remove(randomNPC);
        AttributePool.Add(randomNPC);

        npc.Attributes.cost                   = CalculateEmployeeCost(npc);
        npc.Attributes.costThreshold          = CalculateCostThreshold(npc);
        npc.Attributes.negotiationFrustration = 0;
        npc.Attributes.ammountPaidFor         = 0;

        return(npc);
    }
示例#2
0
	void Awake(){
		this.npcAttributes = new NPCAttributes (health, max_health, attackPower, defense, moveSpeed, experience);
		//print ("Experiencia: " + this.npcAttributes.getExperience ());
		
	}