public CharacterData(CharacterDataTemplate templateArg) { Setup(templateArg.template); // set color hex code from the template's character color characterInfo.characterHexColorCode = ColorUtility.ToHtmlStringRGB(templateArg.characterInfoColor); if (templateArg.favoredWeaponTypesTemplate != null) { favoredWeaponTypes = new WeaponTypeSet(templateArg.favoredWeaponTypesTemplate); } if (templateArg.characterInventoryTemplate != null) { characterInventory = new CharacterInventory(templateArg.characterInventoryTemplate); } factionReputation = new FactionReputation(templateArg.factionReputationTemplate); activeAbilityLoadout = new ActiveAbilityLoadout(); foreach (ActiveAbilityTemplate iterAbilityTemp in templateArg.activeAbilityTemplates) { activeAbilityLoadout.AddActiveAbility(new ActiveAbility(iterAbilityTemp)); } outfitLoadout = new CharacterOutfitLoadout(); foreach (CharacterOutfitTemplate iterTemp in templateArg.outfitTemplates) { outfitLoadout.AddOutfit(iterTemp); } }
private void Setup(FactionReputation inflicterFactionRepArg, float dmgHealPercArg) { inflicterFactionRep = inflicterFactionRepArg; damageHealingLeechPercentage = dmgHealPercArg; statusColor = GeneralMethods.GetColorFromHexColorCode(statusColorHexCode); }
private void Setup(CharacterData templateArg) { characterInfo = new CharacterInfo(templateArg.characterInfo); characterStats = new CharacterStats(templateArg.characterStats); characterInventory = new CharacterInventory(templateArg.characterInventory); favoredWeaponTypes = new WeaponTypeSet(templateArg.favoredWeaponTypes); factionReputation = new FactionReputation(templateArg.factionReputation); activeAbilityLoadout = new ActiveAbilityLoadout(templateArg.activeAbilityLoadout); outfitLoadout = new CharacterOutfitLoadout(templateArg.outfitLoadout); }
private void Setup() { characterInfo = new CharacterInfo(); characterStats = new CharacterStats(); characterInventory = new CharacterInventory(); favoredWeaponTypes = new WeaponTypeSet(); factionReputation = new FactionReputation(); activeAbilityLoadout = new ActiveAbilityLoadout(); outfitLoadout = new CharacterOutfitLoadout(); }
private void Setup(FactionReputation templateArg) { /*factionsToReputationPoints = new SerializableDictionaryFactionDataToInt(); * foreach (FactionData iterDictKey in templateArg.factionsToReputationPoints.Keys) * { * factionsToReputationPoints[iterDictKey] = templateArg. * factionsToReputationPoints[iterDictKey]; * }*/ factionsAndReputationPoints = new List <SerializableDataFactionDataAndInt>(); foreach (SerializableDataFactionDataAndInt iterData in factionsAndReputationPoints) { factionsAndReputationPoints.Add(new SerializableDataFactionDataAndInt(iterData)); } }
/// <summary> /// Returns bool that denotes if given reputation allows this reputation's holder /// to harm the given reputation's holder. /// </summary> /// <param name="factionRepArg"></param> /// <returns></returns> public bool DoesReputationAllowHarm(FactionReputation factionRepArg) { // if aligned to home faction (i.e. is a comrade or ally) if (factionRepArg.homeFaction.factionId == homeFaction.factionId) { // return whether this faction has friendly fire return(homeFaction.canFriendlyFire); } // else they are a different faction else { // if you are hostile towards them OR they are hostile towards you then you can hurt them return(DoesReputationWarrantHostility(factionRepArg) || factionRepArg.DoesReputationWarrantHostility(this)); } }
public bool AreFactionAllies(FactionReputation attackerRepArg) { // get front facing char data from this character CharacterData surfaceLevelCharData = GeneralMethods.GetFrontFacingCharacterDataFromCharMaster( _characterMasterController); // if char data retrieved if (surfaceLevelCharData != null) { return(surfaceLevelCharData.factionReputation.AreFactionAllies(attackerRepArg)); } // else no char data found else { // return some default bool return(false); } }
/// <summary> /// Returns bool that denotes if the given reputation of an attacker allows this char to be /// harmed by attacker. /// </summary> /// <param name="attackerRepArg"></param> /// <returns></returns> public bool CanAttackerCauseHarmBasedOnReputation(FactionReputation attackerRepArg) { // get front facing char data from this character CharacterData surfaceLevelCharData = GeneralMethods.GetFrontFacingCharacterDataFromCharMaster( _characterMasterController); // if char data retrieved if (surfaceLevelCharData != null) { // returns whether this char's reputation allows the attacker to harm them return(attackerRepArg.DoesReputationAllowHarm(surfaceLevelCharData.factionReputation)); } // else no char data found else { // return some default bool return(false); } }
/// <summary> /// Returns bool that denotes if given reputation warrant hostility towards reputation holder. /// </summary> /// <param name="factionRepArg"></param> /// <returns></returns> public bool DoesReputationWarrantHostility(FactionReputation factionRepArg) { // if aligned to home faction (i.e. is a comrade or ally) if (factionRepArg.homeFaction.factionId == homeFaction.factionId) { // would NOT be hostile towards allies return(false); } // if they have a repuation with home faction if (factionRepArg.AreFamiliarWithFaction(homeFaction)) { // return whether their reputation with home faction warrants hostility return(DoesReputationPointsWarrantHostility(factionRepArg. GetReputationPointsAssociatedWithFaction(homeFaction))); } // else they are NOT familiar with home faction else { /// return whether the home faction is hostile towards those they aren't /// familiar with return(homeFaction.inherentlyHostile); } }
public FactionReputation(FactionReputation templateArg) { Setup(templateArg); }
/// <summary> /// Returns bool that denotes if this char is in the same faction as given rep holder. /// </summary> /// <param name="factionRepArg"></param> /// <returns></returns> public bool AreFactionAllies(FactionReputation factionRepArg) { return(homeFaction.factionId == factionRepArg.homeFaction.factionId); }
public LeechDamageStatusEffect(FactionReputation inflicterFactionRepArg, float dmgHealPercArg) { Setup(inflicterFactionRepArg, dmgHealPercArg); }
public void RemoveDamageHealingLeechProperties(FactionReputation inflicterFactionRepArg, float dmgHealPercArg) { damageHealingLeechPercentage -= dmgHealPercArg; }
public void AddDamageHealingLeechProperties(FactionReputation inflicterFactionRepArg, float dmgHealPercArg) { damageHealingLeechInflicterFactionRep = inflicterFactionRepArg; damageHealingLeechPercentage += dmgHealPercArg; }