void getHeroData() { hero = GM.playerHero; good = GM.playerGood; HeroData = new List<hero> (); foreach (playerHero playerGo in hero) foreach (hero allGo in GM.allHero) if(playerGo.code==allGo.code){ hero go=new hero(); go.clone(allGo); go.level=playerGo.level; GM.changeAttributeLevel(go); go.thisData.clone(go.maxData); HeroData.Add(go); continue; } }
//怪物数据 void getEnemyData() { enemyData = new List<hero>(); foreach (enemyHero EH in levelEnemyHero) foreach (hero ED in allHero) { if (EH.elementCode == ED.code) { for(int i=0;i<EH.num;i++){ hero go=new hero(); go.clone(ED); go.level=EH.level; changeAttributeLevel(go); go.maxData.hp+=EH.hp; go.maxData.at+=EH.at; go.thisData.clone(go.maxData); enemyData.Add (go); } continue; } } }