|
@@ -40,6 +40,7 @@ public class GameManager : MonoBehaviour
|
|
|
[FoldoutGroup("金币结算")][LabelText("额外金币奖励")] public int extraMoney;
|
|
[FoldoutGroup("金币结算")][LabelText("额外金币奖励")] public int extraMoney;
|
|
|
[FoldoutGroup("金币结算")][LabelText("惩罚时间间隔")] public int deductMoneyTime;
|
|
[FoldoutGroup("金币结算")][LabelText("惩罚时间间隔")] public int deductMoneyTime;
|
|
|
[FoldoutGroup("金币结算")][LabelText("每次惩罚扣除金币数量")] public int deductMoney;
|
|
[FoldoutGroup("金币结算")][LabelText("每次惩罚扣除金币数量")] public int deductMoney;
|
|
|
|
|
+ [FoldoutGroup("金币结算")][LabelText("怪物掉落金币数量")] public int enemyGoldDrop;
|
|
|
|
|
|
|
|
[FoldoutGroup("Rogue数值")] [LabelText("伤害")] public int damage;
|
|
[FoldoutGroup("Rogue数值")] [LabelText("伤害")] public int damage;
|
|
|
[FoldoutGroup("Rogue数值")] [LabelText("暴击率")] public int criticalChance;
|
|
[FoldoutGroup("Rogue数值")] [LabelText("暴击率")] public int criticalChance;
|
|
@@ -134,6 +135,7 @@ public class GameManager : MonoBehaviour
|
|
|
public void GameEnd()
|
|
public void GameEnd()
|
|
|
{
|
|
{
|
|
|
gameType = GameType.GameEnd;
|
|
gameType = GameType.GameEnd;
|
|
|
|
|
+ int dropGold = 0;
|
|
|
foreach (List<Enemy> objs in EnemyCreater.instance.enemyDic.Values)
|
|
foreach (List<Enemy> objs in EnemyCreater.instance.enemyDic.Values)
|
|
|
{
|
|
{
|
|
|
for (int i = 0; i < objs.Count; i++)
|
|
for (int i = 0; i < objs.Count; i++)
|
|
@@ -142,6 +144,7 @@ public class GameManager : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
objs[i].killer = null;
|
|
objs[i].killer = null;
|
|
|
objs[i].ChangeState(CharacterState.Die);
|
|
objs[i].ChangeState(CharacterState.Die);
|
|
|
|
|
+ dropGold += enemyGoldDrop;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -149,11 +152,11 @@ public class GameManager : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- AddMoney();
|
|
|
|
|
|
|
+ AddMoney(dropGold);
|
|
|
shopButton.SetActive(true);
|
|
shopButton.SetActive(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void AddMoney()
|
|
|
|
|
|
|
+ public void AddMoney(int enemyDrop)
|
|
|
{
|
|
{
|
|
|
int addMoney;
|
|
int addMoney;
|
|
|
if(gameTime < rewardTime)
|
|
if(gameTime < rewardTime)
|
|
@@ -165,7 +168,8 @@ public class GameManager : MonoBehaviour
|
|
|
int extraTime = (int)gameTime - rewardTime;
|
|
int extraTime = (int)gameTime - rewardTime;
|
|
|
addMoney = Mathf.Clamp(totalMoney - (extraTime / deductMoneyTime) * deductMoney, 0, totalMoney);
|
|
addMoney = Mathf.Clamp(totalMoney - (extraTime / deductMoneyTime) * deductMoney, 0, totalMoney);
|
|
|
}
|
|
}
|
|
|
- money += Mathf.RoundToInt(addMoney * increasedGoldGain / 100f);
|
|
|
|
|
|
|
+ addMoney += enemyDrop;
|
|
|
|
|
+ money += Mathf.RoundToInt(addMoney * (1 + increasedGoldGain / 100f));
|
|
|
moneyText.text = $"{money}";
|
|
moneyText.text = $"{money}";
|
|
|
}
|
|
}
|
|
|
|
|
|