예제 #1
0
 public bool Recruit(Dood dood)
 {
     // Calculate need for role [0, 1]
     float need = (roster.Count - roleCount[UnitBuilder.roles.IndexOf(dood.role)]) / roster.Count;
     // Prioritize tanks/healers
     if(	(need >= 0.2f && dood.role == UnitBuilder.roles[0]) ||
        (need >= 0.1f && dood.role == UnitBuilder.roles[1]))
     {
         need *= 3f;
     }
     // Compare equipLevel [0, inf)
     float gearcheck = (1f * dood.equipLevel) / avgScore;
     // Check for endorsements [0, 1]
     float endorsement = 0f;
     int numFriends = 0;
     foreach (Dood clannie in roster){
         if(clannie.friendship.ContainsKey(dood)){
             endorsement += clannie.friendship[dood];
             numFriends++;
         }
     }
     // Decision
     return 1f < ((need * gearcheck) + (2f * endorsement / numFriends));
 }
예제 #2
0
 public void rosterRemove(Dood dood)
 {
     roster.Remove (dood);
     // TODO: Remove when Count == 1. Figure out where the last guy decides to go...
     if(roster.Count == 0){
         //Debug.Log (name+" has disbanded!");
         RelationsTracker.activeClans.Remove(this);
     } else {
         recalcStats();
     }
 }
예제 #3
0
 public void rosterAdd(Dood dood)
 {
     roster.Add (dood);
     recalcStats();
 }
예제 #4
0
 public static void createNewClan(Dood[] doods)
 {
     Clan newClan = new Clan(clans[popClan()], false);
     //Debug.Log("New Clan: "+newClan.name+" has been founded!");
     foreach (Dood dood in doods){
         dood.swapClans (newClan);
         dood.modifyHappy (0.2f); // Even better than joining an existing clan!
     }
     newClan.recalcStats();
     RelationsTracker.activeClans.Add(newClan);
 }
예제 #5
0
 public void setFriendship(Dood other, float score)
 {
     if(score <= 0f) return; if(score > 1f) score = 1f;
     if(friendship.ContainsKey(other)){
         friendship[other] = score;
     } else {
         friendship.Add (other, score);
     }
 }
예제 #6
0
 public bool isClannie(Dood other)
 {
     return clan == other.clan;
 }