Search in sources :

Example 1 with NPCCharacterTrait

use of de.gg.game.model.types.NPCCharacterTrait in project ProjektGG by eskalon.

the class CharacterBehaviour method getImpeachmentVoteOption.

private static int getImpeachmentVoteOption(short characterId, ImpeachmentBallot matter, GameSession session) {
    int tmp = -20;
    short characterToImpeachId = matter.getPos().getCurrentHolder();
    Character character = session.getWorld().getCharacter(characterId);
    NPCCharacterTrait trait = character.getNPCTrait();
    if (characterId == characterToImpeachId) {
        tmp = 150;
    } else {
        int opinion = getOpinionOfAnotherCharacter(characterToImpeachId, characterId, session);
        tmp += opinion;
        int posLevel = matter.getType().getLevel();
        if (trait != null) {
            // Ambition
            if (character.getPosition().getLevel() + 1 == posLevel)
                tmp += trait.getAmbitionDecisionModifier() - 15;
            // Loyalty
            if (opinion >= 55)
                tmp += trait.getGeneralLoyaltyDecisionModifier();
        }
    }
    return tmp < 0 ? characterToImpeachId : -1;
}
Also used : NPCCharacterTrait(de.gg.game.model.types.NPCCharacterTrait) Character(de.gg.game.model.entities.Character)

Aggregations

Character (de.gg.game.model.entities.Character)1 NPCCharacterTrait (de.gg.game.model.types.NPCCharacterTrait)1