//HP差があればダメージ2倍 void HpAttack(GamePlayerManager attacker, GamePlayerManager defender) { Debug.Log("HP差特攻" + strength); int hpDifference = defender.hp - attacker.hp; Debug.Log(hpDifference); if (hpDifference > 0) { Debug.Log("特攻あり"); damageCal /= 2; switch (strength) { case 0: damageCal *= 3; break; case 1: damageCal *= 4; break; case 2: damageCal *= 5; break; } effectMessage = "HP差によりダメージが増加する!"; } }
//相手のコストを下げる void ReduceEnemyCost(GamePlayerManager defender, bool isMyTurn) { Debug.Log("コスト減少" + strength); switch (strength) { case 0: defender.cost -= 1; break; case 1: defender.cost -= 2; break; case 2: defender.cost -= 3; break; } if (defender.cost < 0) { defender.cost = 0; } StartCoroutine(uiManager.ShowCost(!isMyTurn)); }
//相手のコスト分ダメージ増加 void EnemyCostBonus(GamePlayerManager defender, bool isMyTurn) { Debug.Log("相手のコスト分ダメージ増加" + strength); int addDamage = defender.cost * 30; switch (strength) { case 0: break; case 1: addDamage /= 2; addDamage *= 3; break; case 2: addDamage *= 2; break; } Debug.Log("追加ダメージ" + addDamage); damageCal += addDamage; if (isMyTurn) { effectMessage = "あいてのコスト分カロリーが上昇する"; } else { effectMessage = "あなたのコスト分カロリーが上昇する"; } }
//自分の状態異常分ダメージ増加 void MyConditionBonus(GamePlayerManager attacker, bool isMyTurn) { Debug.Log("自分の状態異常分ダメージ増加" + strength); int addDamage = (attacker.poisonCount + attacker.darkCount + attacker.paralysisCount) * 50; switch (strength) { case 0: break; case 1: addDamage /= 2; addDamage *= 3; break; case 2: addDamage *= 2; break; } Debug.Log("追加ダメージ" + addDamage); damageCal += addDamage; if (isMyTurn) { effectMessage = "あなたの状態異常の数だけカロリーが上昇する"; } else { effectMessage = "あいての状態異常の数だけカロリーが上昇する"; } }
void CostAttack(GamePlayerManager attacker, GamePlayerManager defender, bool isMyTurn) { Debug.Log("コスト差特攻" + strength); int costDifference = defender.cost - attacker.cost; if (costDifference > 3) { Debug.Log("特攻あり"); damageCal /= 2; switch (strength) { case 0: damageCal *= 3; break; case 1: damageCal *= 4; break; case 2: damageCal *= 5; break; } effectMessage = "コスト差によりダメージが増加する!"; } }
//自分のコスト増加 void IncreaseMyCost(GamePlayerManager attacker, bool isMyTurn) { Debug.Log("コスト増加" + strength); switch (strength) { case 0: attacker.cost += 1; break; case 1: attacker.cost += 2; break; case 2: attacker.cost += 3; break; } if (attacker.cost > 6) { attacker.cost = 6; } StartCoroutine(uiManager.ShowCost(isMyTurn)); }
//2回目以降強くなる void SecondAttack(GamePlayerManager attacker) { Debug.Log("2回目以降なら強くなる"); if (!attacker.usedDish) { attacker.usedDish = true; effectMessage = "次に食べた時カロリーが上昇する!"; return; } else { int calUp = 0; switch (strength) { case 0: calUp = 100; break; case 1: calUp = 150; break; case 2: calUp = 200; break; } effectMessage = "食べたことがあるため、カロリーが上昇する!"; damageCal += calUp; } }
//与えたダメージで回復 void DamageHealHp(GamePlayerManager attacker, bool isMyTurn) { Debug.Log("与えたダメージで回復" + strength); int healCal = damageCal / 10; switch (strength) { case 0: healCal *= 5; break; case 1: healCal *= 10; break; case 2: healCal *= 15; break; } attacker.hp += healCal; uiManager.ShowHealText(healCal, isMyTurn); }
//HP回復 void HealHp(GamePlayerManager attacker, bool isMyTurn) { Debug.Log("回復" + strength); int healCal = 0; switch (strength) { case 0: healCal = 200; break; case 1: healCal = 250; break; case 2: healCal = 300; break; } attacker.hp += healCal; uiManager.ShowHealText(healCal, isMyTurn); }
public void SetEatCard(CardModel cardModel) { GamePlayerManager player = GameObject.Find("Player").GetComponent <GamePlayerManager>(); nameText.text = cardModel.name; calText.text = cardModel.cal + "Kcal"; //料理 if (cardModel.kind == KIND.DISH) { //string[] effectText = DecideDishEffectText(cardModel.cardID, cardModel.isStrong); if (player.darkCount > 0) { nameText.text = "?????"; calText.text = "???Kcal"; //effectText.fontSize = 30; this.effectText.text = "\"暗闇\"で料理が見えない"; } else { iconImage.sprite = cardModel.icon; string[] effectText = new string[3] { null, null, null }; effectText = dishInformation.DishEffectText(cardModel.cardID, cardModel.isStrong); this.effectText.text = effectText[0] + $"<color=#EE3CEE>{effectText[1]}</color>" + $"<color=#000000>{effectText[2]}</color>"; //for (int i = 0; i < 2; i++) //{ // this.effectText[i].text = effectText[i]; //} } } else { effectText.fontSize = 30; effectText.text = "料理コスト +" + cardModel.cost; //effectText[1].text = ""; iconImage.sprite = cardModel.icon; } rareEffectObj.SetActive(cardModel.isStrong); }
//試合中に使う度強くなる //void StrongerAttack(GamePlayerManager attacker, GamePlayerManager defender) //{ // Debug.Log("使う度強くなる" + strength); // defender.hp -= (attacker.usedCount * 50); // switch (strength) // { // case 0: // attacker.usedCount += 1; // break; // case 1: // attacker.usedCount += 2; // break; // case 2: // attacker.usedCount += 4; // break; // } //} //void MultiAttack(bool isMyTurn, int damageCal) //{ // if (!isMyTurn) // { // return; // } // Debug.Log("複数回攻撃" + strength); // int a = -1; // int additionalNum = 0; // GamePlayerManager damagePlayer = player[1]; // switch (strength) // { // case 0: // a = Random.Range(0, 4); // //01 // if (a <= 1) // { // additionalNum = 0; // } // //2 // else if (a <= 2) // { // additionalNum = 1; // } // //3 // else // { // additionalNum = 2; // } // break; // case 1: // a = Random.Range(0, 3); // //01 // if (a <= 1) // { // additionalNum = 1; // } // //2 // else if (a <= 2) // { // additionalNum = 2; // } // break; // case 2: // additionalNum = 3; // break; // } // int damage = damageCal * additionalNum; // GameManager.instance.AdditionalDamage(damagePlayer, damage); //} //ランダムでダメージ void RandomDamage(bool isMyTurn) { effectMessage = "ランダムでどちらかに大ダメージ!"; if (!isMyTurn) { return; } Debug.Log("ランダムダメージ" + strength); int a = Random.Range(0, 100); GamePlayerManager damagePlayer = null; switch (strength) { case 0: if (a < 50) { damagePlayer = player[0]; } else { damagePlayer = player[1]; } break; case 1: if (a < 30) { damagePlayer = player[0]; } else { damagePlayer = player[1]; } break; case 2: if (a < 10) { damagePlayer = player[0]; } else { damagePlayer = player[1]; } break; } GameManager.instance.AdditionalDamage(damagePlayer, 100); }
// Start is called before the first frame update void Start() { _scoreText.text = "Score: 0"; _gameOverText.gameObject.SetActive(false); _restartText.gameObject.SetActive(false); _gameManager = GameObject.Find("Game_Manager").GetComponent <GamePlayerManager>(); if (_gameManager == null) { Debug.LogError("Game Manager Not Found"); } }
public void Awake() { if (Instence == null) { Instence = this; ResetWord(); } else { DestroyImmediate(gameObject); } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != null) { Instance = null; Instance = this; } MakePlayer(); }
//次ターンのダメージを軽減する void OneDefence(GamePlayerManager attacker) { Debug.Log("次ターンのダメージを軽減する"); switch (strength) { case 0: attacker.defenceDish = 1; break; case 1: attacker.defenceDish = 2; break; case 3: attacker.defenceDish = 3; break; } }
//次の攻撃を強くする void NextAttack(GamePlayerManager attacker) { Debug.Log("次の攻撃を強化"); switch (strength) { case 0: attacker.nextAttack = 3; break; case 1: attacker.nextAttack = 4; break; case 2: attacker.nextAttack = 5; break; } }
//相手を麻痺に void Paralysis(GamePlayerManager defender) { Debug.Log("麻痺付与" + strength); switch (strength) { case 0: defender.paralysisCount = 3; break; case 1: defender.paralysisCount = 4; break; case 2: defender.paralysisCount = 5; break; } }
//相手を毒に void Poison(GamePlayerManager defender) { Debug.Log("毒付与" + strength); switch (strength) { case 0: defender.poisonCount = 3; break; case 1: defender.poisonCount = 4; break; case 2: defender.poisonCount = 5; break; } }
private void FixedUpdate() { if (_GPM == null) { _GPM = FindObjectOfType <GamePlayerManager>(); } if (_GPM != null) { if (_Player1isIcebert == true) { _GPM.SetControllertoIcebert = 0; _GPM.SetControllertoSpicegirl = 1; } else if (_Player1isIcebert == false) { _GPM.SetControllertoIcebert = 1; _GPM.SetControllertoSpicegirl = 0; } } }
//相手を暗闇に void Dark(GamePlayerManager defender) { Debug.Log("暗闇付与" + strength); switch (strength) { case 0: defender.darkCount = 3; break; case 1: defender.darkCount = 4; break; case 2: defender.darkCount = 5; break; } }
static void Main(string[] args) { GamePlayer player1 = new GamePlayer { NationalityId = "2222222222", FirstName = "Uğur", LastName = "Çivgin", DateOfBirth = 1994 }; GamePlayer player2 = new GamePlayer { NationalityId = "3333333333", FirstName = "sait", LastName = "Çivgin", DateOfBirth = 2010 }; Game game1 = new Game { GameName = "Hitman", GamePrice = 1500 }; Game game2 = new Game { GameName = "Soldier", GamePrice = 200 }; GameManager gameManager = new GameManager(); gameManager.Add(game1); gameManager.Delete(game1); gameManager.Update(game1); GamePlayerManager gamePlayerManager = new GamePlayerManager(); gamePlayerManager.Ekle(player1); gamePlayerManager.Delete(player1); gamePlayerManager.Update(player1); CampignManeger campignManeger = new CampignManeger(); campignManeger.CalculateSale(game1); campignManeger.SaleInformation(game1); MernisServiceAdapter mernisServiceAdapter = new MernisServiceAdapter(); mernisServiceAdapter.CheckIfRealPerson(player1); }
//ID=22 public void AdditionalDamage(GamePlayerManager damagePlayer, int damage) { int damagePlayerID = -1; //自分にダメージ if (player[0] == damagePlayer) { damagePlayerID = this.playerID; } //相手にダメージ else { if (playerID == 0) { damagePlayerID = 1; } else { damagePlayerID = 0; } } photonView.RPC(nameof(AdditionalDamage_RPC), RpcTarget.AllViaServer, damagePlayerID, damage); }
//状態異常特攻 void ConditionAttack(GamePlayerManager defender, bool isMyTurn) { Debug.Log("状態異常特攻" + strength); if (defender.poisonCount > 0 || defender.darkCount > 0 || defender.paralysisCount > 0) { Debug.Log("特攻あり"); damageCal /= 2; switch (strength) { case 0: damageCal *= 3; break; case 1: damageCal *= 4; break; case 2: damageCal *= 5; break; } if (isMyTurn) { effectMessage = "あいてが状態異常なのでダメージが増加する!"; } else { effectMessage = "あなたが状態異常なのでダメージが増加する!"; } } }
//状態異常解除 void HealCondition(GamePlayerManager attacker, GamePlayerManager defender, bool isMyTurn) { Debug.Log("状態異常解除" + strength); switch (strength) { case 0: break; case 1: defender.poisonCount += attacker.poisonCount; defender.darkCount += attacker.darkCount; defender.paralysisCount += attacker.paralysisCount; break; case 2: if (attacker.poisonCount > 0) { defender.poisonCount += attacker.poisonCount; defender.poisonCount += 3; } if (attacker.darkCount > 0) { defender.darkCount += attacker.darkCount; defender.darkCount += 3; } if (attacker.paralysisCount > 0) { defender.paralysisCount += attacker.paralysisCount; defender.paralysisCount += 3; } break; } attacker.poisonCount = 0; attacker.darkCount = 0; attacker.paralysisCount = 0; if (isMyTurn) { if (strength == 0) { effectMessage = "状態異常が治った!"; } else { effectMessage = "状態異常があいてにうつった!"; } } else { if (strength == 0) { effectMessage = "あいての状態異常が治った!"; } else { effectMessage = "状態異常をうつされた!"; } } }
private void Awake() { GamePlayerManager.instance = this; this.playerMap = new Dictionary<int, GamePlayer>(); this.commander1 = null; this.commander2 = null; this.fighters1 = new List<GamePlayer>(); this.fighters2 = new List<GamePlayer>(); }
//料理の効果 public IEnumerator DishEffect(int cardID, bool isStrong, int damageCal, bool isAttacker) { messageController.messagePanel.SetActive(true); messageController.ChangeMessageColor(isAttacker); this.isStrong = isStrong; this.damageCal = damageCal; this.isAttacker = isAttacker; effectMessage = null; if (isAttacker) { attacker = player[0]; defender = player[1]; attackerName = gameManager.playerName[0]; defenderName = gameManager.playerName[1]; } else { attacker = player[1]; defender = player[0]; attackerName = gameManager.playerName[1]; defenderName = gameManager.playerName[0]; } if (cardID == 0) { messageController.EatMessage(gameManager.eatCardController[attacker.playerIndex].model, isAttacker); yield return(new WaitForSeconds(2f)); } //攻撃できなくても効果が出るもの switch (cardID) { case 0: RandomEffect(); break; case 1: GamblingAttack(); break; case 2: RandomDamage(); break; case 3: EnemyCostBonus(); break; case 4: MyConditionBonus(); break; case 5: TurnCountBonus(); break; case 6: ThrowEnemyRare(); break; case 7: IncreaseMyRare(); break; case 8: StealEnemyRare(); break; case 9: HealHp(); break; case 10: DamageHealHp(); break; case 11: HealCondition(); break; case 12: DishAttack(); break; case 13: ConditionAttack(); break; case 14: BadIngredientAttack(); break; case 15: StealEnemyCost(); break; case 16: IncreaseMyCost(); break; case 17: ReduceEnemyCost(); break; case 18: Clumsy(); break; case 19: Dark(); break; case 20: Poison(); break; case 21: ReduceDamage(); break; case 22: DamageCounter(); break; case 23: InvalidateEffect(); break; case 24: WeakenIngredient("赤食材"); break; case 25: WeakenIngredient("黄食材"); break; case 26: WeakenIngredient("緑食材"); break; default: Debug.Log("料理範囲外"); break; } if (effectMessage != null) { messageController.EffectMessage(effectMessage); effectMessage = null; yield return(new WaitForSeconds(2f)); } //ランダム if (cardID == 0) { gameManager.eatCardController[attacker.playerIndex].model.cardID = randomCardID; randomCardID = -1; if (isAttacker || gameManager.single) { gameManager.DamageCalculation(); } } else { gameManager.CheckStatus(); } }