/* * public int GetCharacterRelationship(Character c) * { * if(_parentCharacter.Faction == c.Faction) * { * if(_parentCharacter.Faction != Faction.Loner) * { * return 4; * } * else * { * if(_parentCharacter.SquadID == c.SquadID) * { * return 4; * } * else * { * return (Convert.ToInt32(c.SquadID) + Convert.ToInt32(_parentCharacter.SquadID)) > 30 ? 1 : 2; //loner relationships are random * } * } * } * else * { * FactionData myFaction = GameManager.Inst.NPCManager.GetFactionData(_parentCharacter.Faction); * FactionData otherFaction = GameManager.Inst.NPCManager.GetFactionData(c.Faction); * * if(myFaction == null || otherFaction == null) * { * return 1; * } * * float relationship = myFaction.GetRelationshipByID(c.Faction); * if(relationship <= 0.25) * { * return 1; * } * else if(relationship <= 0.5) * { * return 2; * } * else if(relationship <= 0.75) * { * return 3; * } * else * { * return 4; * } * * } * } */ public int IsCharacterEnemy(Character c) //0=enemy, 1=negative neutral, 2=positive neutral, 3=friendly { if (_parentCharacter.Faction == c.Faction) { if (_parentCharacter.Faction != Faction.Loner) { return(3); } else { if (_parentCharacter.SquadID == c.SquadID) { return(3); } else { int rand = (Convert.ToInt32(c.SquadID) + Convert.ToInt32(_parentCharacter.SquadID)); //loner relationships are random if (rand > 30) { return(0); } else { return(2); } } } } else { FactionData myFaction = GameManager.Inst.NPCManager.GetFactionData(_parentCharacter.Faction); FactionData otherFaction = GameManager.Inst.NPCManager.GetFactionData(c.Faction); if (myFaction == null || otherFaction == null) { return(0); } float relationship = myFaction.GetRelationshipByID(c.Faction); if (relationship <= 0.25f) { return(0); } else if (relationship <= 0.5f) { return(1); } else if (relationship <= 0.75f) { return(2); } else if (relationship > 0.75f) { return(3); } } return(0); }