public ReputationState GetNewRepForCharacter(string characterName) { //TODO add faction etc. ReputationState repState = new ReputationState(); repState.Modifiers.Add(GlobalReputationModifier); return(repState); }
public int GetPersonalReputation(string characterName) { ReputationState rep = null; if (!CharacterReputation.TryGetValue(characterName, out rep)) { rep = GetNewRepForCharacter(characterName); CharacterReputation.Add(characterName, rep); Player.Get.AvatarActions.ReceiveAction(AvatarAction.NpcReputationChange, WorldClock.AdjustedRealTime); } return(rep.FinalReputation); }
public void LosePersonalReputation(string characterName, string characterDisplayName, int reputationLoss) { reputationLoss = Mathf.Clamp(reputationLoss, 1, Globals.ReputationChangeMurderer); ReputationState rep = null; if (!CharacterReputation.TryGetValue(characterName, out rep)) { rep = GetNewRepForCharacter(characterName); CharacterReputation.Add(characterName, rep); } rep.PersonalReputation = (int)Mathf.Clamp(rep.PersonalReputation - reputationLoss, Globals.MinReputation, Globals.MaxReputation); Player.Get.AvatarActions.ReceiveAction(AvatarAction.NpcReputationLose, WorldClock.AdjustedRealTime); Player.Get.AvatarActions.ReceiveAction(AvatarAction.NpcReputationChange, WorldClock.AdjustedRealTime); if (!string.IsNullOrEmpty(characterDisplayName)) { GUIManager.PostDanger("Lost " + reputationLoss.ToString() + " reputation with " + characterDisplayName); } }