示例#1
0
 public string NameGen()
 {
     NpcBio = gameObject.GetComponent <CharBio>();
     if (NpcBio.professionType == CharBuilder.ProfessionType.FactionLeader)
     {
         NpcBio.displayName = FactionManager.facts[NpcBio.factionList].leaderTitle;
     }
     if (Chance(NpcBio.charStr) && IsGoodMoral())
     {
         return(RandomFromList(MoralStrongNickNames));
     }
     if (Chance(NpcBio.charStr))
     {
         return(RandomFromList(strongNickNames));
     }
     if (Chance(NpcBio.charDex))
     {
         return(RandomFromList(dexNickNames));
     }
     if (Chance(NpcBio.piety))
     {
         return(RandomFromList(religionGenericNickName));
     }
     if (Chance(NpcBio.maxHealth))
     {
         return(RandomFromList(maxHealthGenericNickName));
     }
     return(NpcBio.displayName);
 }
示例#2
0
文件: Character.cs 项目: MPLLC/GitS
 public Character(CharAttacks attacks, CharBio bio, CharInv inv, CharStats stats)
 {
     this.attacks = attacks;
     this.bio = bio;
     this.inv = inv;
     this.stats = stats;
 }
示例#3
0
    // Update is called once per frame
    //void Update () {
    //
    //}

    public void BuildNow()
    {
        //	Debug.Log("Starting debug");
        CharBio NpcBio = gameObject.GetComponent <CharBio>();

        Debug.Log(NpcBio.charStr);
        NpcBio.charStr      = Random.Range(80f, 110f);
        NpcBio.charSpd      = Random.Range(0.9f, 1.05f);
        NpcBio.charCharisma = Random.Range(90f, 105f);
        NpcBio.charLuck     = Random.Range(.8f, 1.1f);
        NpcBio.maxHealth    = Random.Range(90f, 105f);
        NpcBio.maxThirst    = Random.Range(90f, 105f);
        NpcBio.maxHunger    = Random.Range(90f, 105f);
        NpcBio.maxEnergy    = Random.Range(90f, 105f);
        Debug.Log(NpcBio.charStr);

        switch (NpcBio.professionType)
        {
        case ProfessionType.Soldier:
            NpcBio.charStr         += Random.Range(1f, 10f);
            NpcBio.charCharisma    -= 2f;
            NpcBio.aggressionLevel += 6f;
            Debug.Log(NpcBio.displayName + " is a soldier");
            break;

        case ProfessionType.FactionLeader:
            NpcBio.charCharisma += Random.Range(3f, 12f);
            NpcBio.charSpd      *= 0.95f;
            NpcBio.charStr      += Random.Range(1f, 6f);
            Debug.Log(NpcBio.displayName + " is a faction leader");

            break;

        case ProfessionType.Farmer:
            NpcBio.charSpd *= 0.95f;
            NpcBio.charStr += Random.Range(1f, 6f);
            break;

        default:
            Debug.Log("No profession");
            break;
        }

        if (NpcBio.isMale == true)
        {
            NpcBio.charStr += Random.Range(4f, 7f);
            NpcBio.charDex -= Random.Range(1f, 4f);
        }
        else
        {
            NpcBio.charCharisma += Random.Range(1f, 6f);
            NpcBio.charSpd      *= 1.05f;
            NpcBio.charStr      -= Random.Range(1f, 7f);
            NpcBio.charDex      += 2f;
        }

        gameObject.GetComponent <CharBio>().Invoke("DoneGen", 1);
    }
示例#4
0
 public void Start()
 {
     charBio = gameObject.GetComponent <CharBio>();
 }
示例#5
0
 public PlayerCharacter(CharAttacks attacks, CharBio bio, CharInv inv, CharStats stats, Equipment equipment)
     : base(attacks, bio, inv, stats)
 {
     this.equipment = equipment;
 }
示例#6
0
文件: Enemy.cs 项目: MPLLC/GitS
 public Enemy(CharAttacks attacks, CharBio bio, CharInv inv, CharStats stats)
     : base(attacks, bio, inv, stats)
 {
 }
示例#7
0
 private void Start()
 {
     NpcBio = gameObject.GetComponent <CharBio>();
 }