public System.Object ActionFunction_Skill_Range(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") + a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4"); double tempValue = 0.0d; double geneA, geneB, geneC , geneD; if (a.GetPropertyElement ("Range") < 20) return MaxValue; if (a.GetPropertyElement ("Type") == 1) { if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time); MaxValue = 1000000.0d; } return MaxValue; } if(SimulationType == 1) { geneA = -48.0d; geneB = 22.0d; geneC = 24.0d; geneD = 176.0d; } else { geneA = a.GetActionObject("Skill_Range" ).FindWeight ("Range_Gene_A"); geneB = a.GetActionObject("Skill_Range" ).FindWeight ("Range_Gene_B"); geneC = a.GetActionObject("Skill_Range" ).FindWeight ("Range_Gene_C"); geneD = a.GetActionObject("Skill_Range" ).FindWeight ("Range_Gene_D"); } if (a.GetPropertyElement ("Range") < 20) return MaxValue; if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time); for(int i = 0 ; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { tempValue =((scoreConversion(-25.0d,Total_Enemy)*geneA) )*4.0d; if(MaxValue < tempValue) { MaxValue = tempValue; } } } } return MaxValue; }
public System.Object ActionFunction_Skill_Defensive(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double total_hp = a.GetPropertyElement ("HP"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") + a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4"); double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") + a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4"); double geneA, geneB, geneC , geneD; if (a.GetPropertyElement ("Defensive") < 20) return MaxValue; if (a.GetPropertyElement ("Type") == 1) { if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time); MaxValue = 1000000.0d; } return MaxValue; } if(SimulationType == 1) { geneA = 400.0d; geneB = -1.0d; geneC = 6.0d; geneD = 5.0d; } else { geneA = a.GetActionObject("Skill_Defensive" ).FindWeight ("Defensive_Gene_A"); geneB = a.GetActionObject("Skill_Defensive" ).FindWeight ("Defensive_Gene_B"); geneC = a.GetActionObject("Skill_Defensive" ).FindWeight ("Defensive_Gene_C"); geneD = a.GetActionObject("Skill_Defensive" ).FindWeight ("Defensive_Gene_D"); } if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time); for(int i = 0 ; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+ (scoreConversion(25.0d,Total_Home)*geneB)+ (scoreConversion(25.0d,Total_Enemy)*geneD)+ (scoreConversion(25.0d,attackedCount)*geneC) )*2.0d; if(MaxValue < tempValue) { MaxValue = tempValue; } } } } return MaxValue; }
public System.Object ActionFunction_Skill_CON(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double total_hp = a.GetPropertyElement ("HP"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double geneA, geneB, geneC ,geneD; if (a.GetPropertyElement ("CON") < 20) return MaxValue; if (a.GetPropertyElement ("Type") == 1) { if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time); MaxValue = 1000000.0d; } return MaxValue; } if(SimulationType == 1) { geneA = 44.0d; geneB = 100.0d; geneC = 100.0d; geneD = 1.0d; } else { geneA = a.GetActionObject("Skill_CON" ).FindWeight ("CON_Gene_A"); geneB = a.GetActionObject("Skill_CON" ).FindWeight ("CON_Gene_B"); geneC = a.GetActionObject("Skill_CON" ).FindWeight ("CON_Gene_C"); geneD = a.GetActionObject("Skill_CON" ).FindWeight ("CON_Gene_D"); } if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time); for(int i = 0 ; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA) )*4.0d; if(MaxValue < tempValue) { MaxValue = tempValue; } } } } return MaxValue; }
public System.Object ActionFunction_Skill_Critical(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double hp =a.GetPropertyElement("CurHp"); double damage = a.GetPropertyElement ("Monster_Damage"); double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed"); double tempValue = 0.0d; double geneA, geneB, geneC ,geneD; double pointX = a.GetPropertyElement ("PositionX"); double pointY = a.GetPropertyElement ("PositionY"); Vector2 a_v; GameObject Target_Temp; if (a.GetPropertyElement ("Critical") < 20) return MaxValue; if (a.GetPropertyElement ("Type") == 1) { if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time); MaxValue = 1000000.0d; } return MaxValue; } if(SimulationType == 1) { geneA = -2.0d; geneB = 195.0d; geneC = 43.0d; geneD = -3.0d; } else { geneA = a.GetActionObject("Skill_Critical" ).FindWeight ("Critical_Gene_A"); geneB = a.GetActionObject("Skill_Critical" ).FindWeight ("Critical_Gene_B"); geneC = a.GetActionObject("Skill_Critical" ).FindWeight ("Critical_Gene_C"); geneD = a.GetActionObject("Skill_Critical" ).FindWeight ("Critical_Gene_D"); } if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) { a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time); for(int i = 0 ; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { Target_Temp = GameObject.Find (b[i].ObjectID); a_v= new Vector2((float)pointX,(float)pointY); dis = Vector2.Distance (a_v, Target_Temp.transform.position); tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+ (scoreConversion(25.0d,b[i].GetPropertyElement("AttackedCount"))*geneB)+ (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+ (scoreConversion(-19.0d,dis)*geneD) )*2.0d; if(MaxValue < tempValue) { MaxValue = tempValue; } } } } return MaxValue; }
public System.Object ActionFunction_Attack(SIMONObject a, SIMONObject[] b) { double MaxValue = -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double damage = a.GetPropertyElement ("Monster_Damage"); double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double defensive = a.GetPropertyElement("Defensive"); double total_hp = a.GetPropertyElement ("HP"); double geneA, geneC, geneD; double pointX = a.GetPropertyElement ("PositionX"); double pointY = a.GetPropertyElement ("PositionY"); Vector2 a_v; GameObject Target_Temp; if (a.GetPropertyElement ("Type") == 1) { for (int i = 0; i < b.Length; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { Target_Temp = GameObject.Find (b[i].ObjectID); a_v= new Vector2((float)pointX,(float)pointY); dis = Vector2.Distance (a_v, Target_Temp.transform.position); if (dis < a.GetPropertyElement("Monster_Range")) { tempValue = 100000.0d - b[i].GetPropertyElement("CurHp")+100000; if(MaxValue < tempValue) { MaxValue = tempValue; a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID")); a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive")); a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp")); } } } } return MaxValue; } if(SimulationType == 1) { geneA = 192.0d; geneC = 20.0d; geneD = 2.4d; } else { geneA = a.GetActionObject("Attack").FindWeight ("Attack_Gene_A"); geneC = a.GetActionObject("Attack").FindWeight ("Attack_Gene_C"); geneD = a.GetActionObject("Attack").FindWeight ("Attack_Gene_D"); } for (int i = 0; i < b.Length; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { Target_Temp = GameObject.Find (b[i].ObjectID); a_v= new Vector2((float)pointX,(float)pointY); dis = Vector2.Distance (a_v, Target_Temp.transform.position); if (dis < a.GetPropertyElement("Monster_Range")) { tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+ (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+ (scoreConversion(-19.0d,dis)*geneD) ); if(MaxValue < tempValue) { MaxValue = tempValue; a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID")); a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive")); a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp")); } } } } return MaxValue; }
public System.Object ActionFunction_Defense(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double total_hp = a.GetPropertyElement ("HP"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") + a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4"); double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") + a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4"); double geneA, geneB, geneD; if (a.GetPropertyElement ("Type") == 1) { if (a.GetPropertyElement ("HP") / 2 > a.GetPropertyElement ("CurHp")) { MaxValue = Random.Range(100,200); } return MaxValue; } if(SimulationType == 1) { geneA = 80.0d; geneB = -17.0d; geneD = -9.0d; } else { geneA = a.GetActionObject("Defense").FindWeight ("Defense_Gene_A"); geneB = a.GetActionObject("Defense").FindWeight ("Defense_Gene_B"); geneD = a.GetActionObject("Defense").FindWeight ("Defense_Gene_D"); } if (a.GetPropertyElement ("AttackedCount") == 0) { return MaxValue; } if (a.GetPropertyElement ("HP") == hp) { return MaxValue; } for(int i = 0 ; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+ (scoreConversion(25.0d,Total_Home)*geneB)+ (scoreConversion(25.0d,Total_Enemy)*geneD) ); if(MaxValue < tempValue) { MaxValue = tempValue; } } } return MaxValue; }
public System.Object ActionFunction_Move(SIMONObject a, SIMONObject[] b) { double MaxValue = -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double damage = a.GetPropertyElement ("Monster_Damage"); double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double defensive = a.GetPropertyElement("Defensive"); double total_hp = a.GetPropertyElement ("HP"); double geneA, geneC, geneD; double pointX = a.GetPropertyElement ("PositionX"); double pointY = a.GetPropertyElement ("PositionY"); Vector2 a_v; GameObject Target_Temp; if(SimulationType == 1) { geneA = -0.5d; geneC = 0.0d; geneD = 4.0d; } else { geneA = a.GetActionObject("Move").FindWeight ("Move_Gene_A"); geneC = a.GetActionObject("Move").FindWeight ("Move_Gene_C"); geneD = a.GetActionObject("Move").FindWeight ("Move_Gene_D"); } Target_Temp = GameObject.Find ("Player"); double player_hp = Target_Temp.GetComponent<Player_Controller> ().HC.NowHealth; double player_total_hp = Target_Temp.GetComponent <Player_Controller> ().HC.TotalHealth; if(player_hp > 0 && a.GetPropertyElement("Type") == 1) { a_v= new Vector2((float)pointX,(float)pointY); MaxValue =((scoreConversion(-1.0d * player_total_hp,player_hp)*geneA)+ (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+ (scoreConversion(19.0d,dis)*geneD) ); a.SetPropertyElement("Move_Target",0.0d); } for(int i = 0; i < b.Length ; i++) { if(b[i].GetPropertyElement("CurHp") <=0) continue; if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { Target_Temp = GameObject.Find (b[i].ObjectID); a_v= new Vector2((float)pointX,(float)pointY); dis = Vector2.Distance (a_v, Target_Temp.transform.position); tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+ (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+ (scoreConversion(19.0d,dis)*geneD) ); if(MaxValue < tempValue) { MaxValue = tempValue; a.SetPropertyElement("Move_Target",b[i].GetPropertyElement("ID")); } } } return MaxValue; }
public System.Object ActionFunction_Avoid(SIMONObject a, SIMONObject[] b) { double MaxValue= -1000000.0d; double tempValue = 0.0d; double hp =a.GetPropertyElement("CurHp"); double total_hp = a.GetPropertyElement ("HP"); double attackedCount = a.GetPropertyElement ("AttackedCount"); double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") + a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4"); double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") + a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4"); double geneA, geneB, geneD; if(SimulationType == 1) { geneA = -35.0d; geneB = -0.4d; geneD = -15.0d; } else { geneA = a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_A"); geneB = a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_B"); geneD = a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_D"); } if(a.GetPropertyElement("AttackedCount")==0) { return MaxValue; } if (a.GetPropertyElement ("HP") == hp) { return MaxValue; } for (int i = 1; i < b.Length; i++) { if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type")) { tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+ (scoreConversion(-25.0d,Total_Home)*geneB)+ (scoreConversion(25.0d,Total_Enemy)*geneD) ); if(MaxValue < tempValue) { MaxValue = tempValue; a.SetPropertyElement("Monster_Avoid_State",1.0d); } } } return MaxValue; }