コード例 #1
0
ファイル: isTrait.cs プロジェクト: Frenhasr/GCCAI
 // Use this for initialization
 void Start()
 {
     if (traitString.Equals (TRAIT.isBoredBy.ToString ()))
         t = TRAIT.isBoredBy;
     if (traitString.Equals (TRAIT.isInterestedIn.ToString ()))
         t = TRAIT.isInterestedIn;
 }
コード例 #2
0
    internal TRAIT[] GetTrait()
    {
        TRAIT[] traits       = new TRAIT[2];
        int     trait1Chance = UnityEngine.Random.Range(0, 100);

        if (trait1Chance < 40)
        {
            traits[0] = TRAIT.VICIOUS;
        }
        else
        {
            traits[0] = TRAIT.NAIVE;
        }

        int trait2Chance = UnityEngine.Random.Range(0, 100);

        if (trait2Chance < 20)
        {
            traits[1] = TRAIT.LOYAL;
        }
        else
        {
            int trait3Chance = UnityEngine.Random.Range(0, 100);
            if (trait3Chance < 20)
            {
                traits [1] = TRAIT.TRAITOR;
            }
        }

        return(traits);
    }
コード例 #3
0
ファイル: Character.cs プロジェクト: Frenhasr/GCCAI
    public void changeAffect(TRAIT a)
    {
        switch (a) {

        case TRAIT.isBoredBy:
            affects ["boredomToInterest"].ValueChange (-boredom);
            break;
        case TRAIT.isInterestedIn:
            affects ["boredomToInterest"].ValueChange (interest);
            break;
        case TRAIT.isSaddenedBy:
            affects ["sadToJoy"].ValueChange (-sadness);
            break;
        case TRAIT.enjoys:
            affects ["sadToJoy"].ValueChange (enjoyment);
            break;
        case TRAIT.isDistressedBy:
            affects ["distressToAmused"].ValueChange (-distress);
            break;
        case TRAIT.isAmusedBy:
            affects ["distressToAmused"].ValueChange (amusement);
            break;
        case TRAIT.isAngeredBy:
            affects ["angerToCheers"].ValueChange (-anger);
            break;
        case TRAIT.isCheeredBy:
            affects ["angerToCheers"].ValueChange (amusement);
            break;
        case TRAIT.isDisgustedBy:
            affects ["disgustToLove"].ValueChange (-disgust);
            break;
        case TRAIT.loves:
            affects ["disgustToLove"].ValueChange (love);
            break;
        case TRAIT.isAshamedBy:
            affects ["shameToPride"].ValueChange (-shame);
            break;
        case TRAIT.isProudOf:
            affects ["shameToPride"].ValueChange (pride);
            break;
        case TRAIT.isAfraidOf:
            affects ["fearToHope"].ValueChange (-fear);
            break;
        case TRAIT.hopesFor:
            affects ["fearToHope"].ValueChange (hope);
            break;

        }
    }