Skip to content

Commit

Permalink
t Merge branch 'master' of github.com:GameEgg/STARPOO-II
Browse files Browse the repository at this point in the history
  • Loading branch information
GameEgg committed Jan 23, 2017
2 parents 58d5e15 + 6e456e3 commit d39fb07
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 19 deletions.
11 changes: 7 additions & 4 deletions Assets/Scripts/ResultUI/CardList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ public CardCondition_DamagedByEnemy(float value, bool expect)

override public bool IsSatisfyCondition(FleetHistory fleetHistory)
{
float totalHP = GameConsts.maxShipHp * GameSettings.shipCount;
double var = Math.Round(fleetHistory.damagedByEnemy / (totalHP - fleetHistory.restHP), 4) * 100;
float totalHP = GameConsts.maxShipHp * GameSettings.shipCount;
float damagedHP = totalHP - fleetHistory.restHP;
double var = Math.Round(fleetHistory.damagedByEnemy / damagedHP, 4) * 100;
if (expect == (var > value) || (expect && (var == value)))
return true;
return false;
Expand All @@ -203,7 +204,8 @@ public CardCondition_DamagedByAlly(float value, bool expect)
override public bool IsSatisfyCondition(FleetHistory fleetHistory)
{
float totalHP = GameConsts.maxShipHp * GameSettings.shipCount;
double var = Math.Round(fleetHistory.damagedByAlly / (totalHP - fleetHistory.restHP), 4) * 100;
float damagedHP = totalHP - fleetHistory.restHP;
double var = Math.Round(fleetHistory.damagedByAlly / damagedHP, 4) * 100;
if (expect == (var > value) || (expect && (var == value)))
return true;
return false;
Expand All @@ -222,7 +224,8 @@ public CardCondition_DamagedByWall(float value, bool expect)
override public bool IsSatisfyCondition(FleetHistory fleetHistory)
{
float totalHP = GameConsts.maxShipHp * GameSettings.shipCount;
double var = Math.Round((totalHP - fleetHistory.restHP -fleetHistory.damagedByEnemy - fleetHistory.damagedByAlly) / totalHP, 4) * 100;
float damagedHP = totalHP - fleetHistory.restHP;
double var = Math.Round((damagedHP - fleetHistory.damagedByEnemy - fleetHistory.damagedByAlly) / damagedHP, 4) * 100;
if (expect == (var > value) || (expect && (var == value)))
return true;
return false;
Expand Down
51 changes: 36 additions & 15 deletions Assets/Scripts/ResultUI/CardManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static void InitAllCards()

card = new Card(
"절대자",
"풀피로 완벽하게 승리",
"완벽한 승리.. 혹시 신이세요?",
true,
goodFontColor,
goodColor,
Expand Down Expand Up @@ -148,7 +148,7 @@ public static void InitAllCards()
goodFontColor,
goodColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_HP(50, true));
card.conditions.Add(new CardCondition_HP(70, true));
card.conditions.Add(new CardCondition_HP(90, false));
cardList.Add(card);

Expand All @@ -167,16 +167,16 @@ public static void InitAllCards()
"남은 피 낮음",
"함선의 절반이 자살함",
true,
goodFontColor,
goodColor,
badFontColor,
badColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_HP(0.1f, true));
card.conditions.Add(new CardCondition_HP(10, false));
card.conditions.Add(new CardCondition_DamagedByWall(50, true));
cardList.Add(card);

// 순수 명중률 관련
card = new Card(
"명중률100%",
"명중률 100%",
"명중률 100%",
true,
goodFontColor,
Expand Down Expand Up @@ -225,18 +225,28 @@ public static void InitAllCards()
badFontColor,
badColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_DamageToAlly(50, true));
card.conditions.Add(new CardCondition_DamageToAlly(50, true));
card.conditions.Add(new CardCondition_DamagedByAlly(50, true));
cardList.Add(card);

card = new Card(
"아군 안죽인다",
"아군 그만 좀 때려요",
true,
badFontColor,
badColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_DamagedByAlly(50, false));
card.conditions.Add(new CardCondition_DamagedByAlly(10, true));
cardList.Add(card);

card = new Card(
"아군 안죽인다",
"아군을 거의 안 때림!",
true,
goodFontColor,
goodColor,
badFontColor,
badColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_DamageToAlly(15, false));
card.conditions.Add(new CardCondition_DamagedByAlly(10, false));
cardList.Add(card);

// 적킬
Expand All @@ -250,7 +260,7 @@ public static void InitAllCards()
card.conditions.Add(new CardCondition_DamageToEnemy(70, true));
cardList.Add(card);

// 벽킬
// 벽에게 가한 데미지
card = new Card(
"벽에게 가한 피해(%) 높음",
"저는 벽 쏘는걸 좋아합니다",
Expand Down Expand Up @@ -282,6 +292,7 @@ public static void InitAllCards()
new List<CardCondition>());
card.conditions.Add(new CardCondition_DamagedByWall(70, true));
cardList.Add(card);

card = new Card(
"받은 피해중 벽에게 받은 데미지 (%)가 매우 높음",
"자살 매니아",
Expand All @@ -295,7 +306,7 @@ public static void InitAllCards()

card = new Card(
"받은 피해중 벽에게 받은 데미지 (%)가 높음",
"벽에 좀 부딪혔어요..",
"벽을 사랑하기 시작하였다...",
false,
badFontColor,
badColor,
Expand All @@ -304,7 +315,7 @@ public static void InitAllCards()
card.conditions.Add(new CardCondition_DamagedByWall(20, true));
cardList.Add(card);

// 복합
// 사용에너지
card = new Card(
"레이저를 굉장히 조금만 쏨",
"초 에너지 절약주의자",
Expand All @@ -314,6 +325,16 @@ public static void InitAllCards()
new List<CardCondition>());
card.conditions.Add(new CardCondition_TotalUseEnerge(BattleHistory.maxTotalEnergy * 0.2f, false));
cardList.Add(card);
}

card = new Card(
"레이저를 안씀",
"Peace Keeper",
false,
goodFontColor,
goodColor,
new List<CardCondition>());
card.conditions.Add(new CardCondition_TotalUseEnerge(0.1, false));
cardList.Add(card);
}
}

0 comments on commit d39fb07

Please sign in to comment.