public override void ImplementHability(PlayerManager player, PlayerInstance enemy) { if (!isAvailable) { if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.controller.combatController.UpdatePlayerLog("Desaparecer no disponible."); return; } } base.ImplementHability(player, enemy); isAvailable = false; if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.currentTurn -= turnConsuption; player.controller.combatController.UpdatePlayerLog("¡Has usado Desaparecer!"); NetworkManager.Instance.UpdateEnemyLog(player.playerName + " acaba de desaparecer."); player.ChangeState(stateToChange); } else if (GameState.Instance.CurrentState == GameState.GameStates.exploration) { player.controller.LogStringWithReturn("Has desaparecido."); player.ChangeState(stateToChange); } WaitForCooldown(); }
public void GiveUp(PlayerInstance enemy) { WasteTurn(1); float r = Random.Range(0f, 1f); r *= 100; if (r < characteristics.other.EscapeProbability(this, enemy)) { controller.combatController.UpdatePlayerLog("Te has rendido."); NetworkManager.Instance.UpdateOtherPlayersEnemyLog(controller.combatController.enemyPlayer, playerName + " se ha rendido."); NetworkManager.Instance.PlayerEscapedBattle(enemy); controller.combatController.StopCoroutine(controller.combatController.EndCombatByGivingUp(this)); controller.combatController.StartCoroutine(controller.combatController.EndCombatByGivingUp(this)); } else { controller.combatController.UpdatePlayerLog("No has podido rendirte."); NetworkManager.Instance.UpdateOtherPlayersEnemyLog(controller.combatController.enemyPlayer, "¡" + playerName + " ha intentado rendirse!"); } }
void Start() { base.Start(); playerInstance = this; if (PhotonNetwork.IsMasterClient) { //choose a player to be the teacher Player[] playerList = PhotonNetwork.PlayerList; int teacherInd = Random.Range(0, playerList.Length); for (var i = 0; i < playerList.Length; i++) { if (i == teacherInd) { continue; } //tell player to init eventSystem.RaiseNetworkEvent(EventCodes.OnStudentInitEvent, new object[] { playerList[i].ActorNumber, i }); //teleport player } //tell teacher to init eventSystem.RaiseNetworkEvent(EventCodes.OnTeacherInitEvent, new object[] { playerList[teacherInd].ActorNumber, 4 }); } }
public static void Flee() { if (ModesMenu3["FleeE"].Cast <CheckBox>().CurrentValue) { var ETarget = TargetSelector.GetTarget(E.Range, DamageType.Mixed); if (ETarget == null) { return; } { var Ep = E.GetPrediction(ETarget); if (E.IsInRange(ETarget) && E.IsReady() && ObjectManager.Player.ManaPercent >= Program.ModesMenu3["ManaFlR"].Cast <Slider>().CurrentValue) { E.Cast(Ep.CastPosition); } } } if (ModesMenu3["FleeR"].Cast <CheckBox>().CurrentValue&& ObjectManager.Player.ManaPercent <= Program.ModesMenu3["ManaFlR"].Cast <Slider>().CurrentValue) { if (ObjectManager.Player.CountEnemiesInRange(400) == 0) { var Target = TargetSelector.GetTarget(R.Range, DamageType.Physical); if (Target == null) { return; } var Rp = R.GetPrediction(Target); if (PlayerInstance.GetBuffCount("kogmawlivingartillerycost") < ModesMenu3["FlRStack"].Cast <Slider>().CurrentValue) { R.Cast(Rp.CastPosition); } } } }
private static int AddBanDescription(PlayerInstance ch, string arg1, string arg2, int duration, BanTypes type) { var ban = ch.DestinationBuffer.CastAs <BanData>(); if (ban == null) { LogManager.Instance.Bug("Null DestinationBuffer for character {0}", ch.Name); ch.SubState = CharacterSubStates.None; return(0); } if (!ban.Note.IsNullOrWhitespace()) { ban.Note = string.Empty; } //ban.Note = build.copy_buffer(ch); //build.stop_editing(ch); ch.SubState = EnumerationExtensions.GetEnum <CharacterSubStates>(ch.tempnum); BanManager.Instance.Repository.Add(ban); if (ban.Duration > 0) { ch.Printf("{0} is banned for {1} days.\r\n", ban.Name, ban.Duration / 86400); } else { ch.Printf("{0} is banned forever.\r\n", ban.Name); } return(1); }
private static ReturnTypes ConditionThirsty(PlayerInstance ch, int conditionValue) { var retcode = ReturnTypes.None; if (ch.Level >= LevelConstants.AvatarLevel || ch.CurrentClass == ClassTypes.Vampire) { return(retcode); } ch.SetColor(ATTypes.AT_THIRSTY); var attrib = ConditionTypes.Thirsty.GetAttribute <DescriptorAttribute>(); ch.SendTo(attrib.Messages.ToList()[conditionValue * 2]); if (conditionValue >= 2) { return(retcode); } comm.act(ATTypes.AT_THIRSTY, attrib.Messages.ToList()[conditionValue * 2 + 1], ch, null, null, ToTypes.Room); if (conditionValue == 0) { ch.WorsenMentalState(ch.IsPKill() ? 1 : 2); retcode = ch.CauseDamageTo(ch, 2, (int)SkillNumberTypes.Undefined); } else { ch.WorsenMentalState(1); } return(retcode); }
private bool CheckSiteBans(PlayerInstance ch) { string host = ch.Descriptor.host.ToLower(); bool match = false; foreach (BanData ban in Repository.Bans.Where(x => x.Type == BanTypes.Site)) { if (ban.Prefix && ban.Suffix && host.Contains(ban.Name)) { match = true; } else if (ban.Suffix && host.StartsWith(ban.Name)) { match = true; } else if (ban.Prefix && host.EndsWith(ban.Name)) { match = true; } else if (host.EqualsIgnoreCase(ban.Name)) { match = true; } if (match) { return(CheckBanExpireAndLevel(ban, ch.Level)); } } return(false); }
public void TimesKilled_MobIsPlayer_Test() { PlayerInstance pch = new PlayerInstance(1, "TestChar"); MobileInstance mob = new MobileInstance(2, "TesterMob"); Assert.That(pch.TimesKilled(mob), Is.EqualTo(0)); }
private static void EvaluateThirstCondition(PlayerInstance ch) { var cond = ch.GetCondition(ConditionTypes.Thirsty); var maxCond = GetMaximumCondition(); if (cond > maxCond / 2 && cond < maxCond * 0.4f) { ch.SendTo("Your stomach begins to slosh around."); } else if (cond >= maxCond * 0.4f && cond < maxCond * 0.6f) { ch.SendTo("You start to feel bloated."); } else if (cond >= maxCond * 0.6f && cond < maxCond * 0.9f) { ch.SendTo("You feel bloated."); } else if (cond >= maxCond * 0.9f && cond < maxCond) { ch.SendTo("Your stomach is almost filled to it's brim!"); } else if (cond == maxCond) { ch.SendTo("Your stomach is full, you can't manage to get anymore down."); } }
public override void ImplementHability(PlayerManager player, PlayerInstance enemy) { if (!isAvailable) { if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.controller.combatController.UpdatePlayerLog("Emitir no disponible."); return; } } base.ImplementHability(player, enemy); isAvailable = false; if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.currentTurn -= turnConsuption; player.controller.combatController.UpdatePlayerLog("¡Has usado Emitir!"); NetworkManager.Instance.UpdateEnemyLog(player.playerName + " está emitiendo."); int damage = Random.Range(10, 25); enemy.enemyStats.ReceiveDamage(damage, enemy); float r = Random.Range(0f, 1f); if (r <= (0.1f * habilityLevel)) { NetworkManager.Instance.ChangeNewState(stateToChange.stateName, enemy); } } WaitForCooldown(); }
private void Awake() { playerControls = new PlayerControls(); playerAnimationHandler = GetComponent <PlayerAnimationHandler>(); _playerInstance = GetComponent <PlayerInstance>(); _swingHitBox = GetComponent <CapsuleCollider2D>(); }
private static void AuthorizeCharacter(PlayerInstance ch, PlayerInstance victim) { victim.PlayerData.AuthState = AuthorizationStates.Authorized; victim.PlayerData.AuthorizedBy = ch.Name; throw new NotImplementedException(); }
private static void EvaluateDrunkCondition(PlayerInstance ch) { var cond = ch.GetCondition(ConditionTypes.Drunk); var maxCond = GetMaximumCondition(); if (cond > maxCond / 2 && cond < maxCond * 0.4f) { ch.SendTo("You feel quite sloshed."); } else if (cond >= maxCond * 0.4f && cond < maxCond * 0.6f) { ch.SendTo("You start to feel a little drunk."); } else if (cond >= maxCond * 0.6f && cond < maxCond * 0.9f) { ch.SendTo("Your vision starts to get blurry."); } else if (cond >= maxCond * 0.9f && cond < maxCond) { ch.SendTo("You feel very drunk."); } else if (cond == maxCond) { ch.SendTo("You feel like you're going to pass out."); } }
public void Destroy() { Object.Destroy(PlayerTransform.gameObject); PlayerTransform = null; PlayerModelTransform = null; Movement = null; Animator = null; Effects = null; PlayerInstance.Free(); PlayerInstance = null; if (StarmapMarker != null) { Object.Destroy(StarmapMarker); } if (StarmapNameText != null) { Object.Destroy(StarmapNameText); } if (InGameNameText != null) { Object.Destroy(InGameNameText); } StarmapMarker = StarmapNameText = null; InGameNameText = null; }
public void RunAction(Actor source, Actor target, Card card, BattleContext manager) { if (target is PlayerInstance) { PlayerInstance player = (PlayerInstance)target; ListenableList <ElementCardInstance> handheldList = player.HandheldSet; List <ElementCardInstance> changeList = new List <ElementCardInstance>(); // if drop count greater than 0 if (_count > 0) { for (int cnt = 0; cnt < _count; cnt++) { changeList.Add(handheldList.Get(cnt)); } //if drop count smaller than 0, drop all } else if (_count < 0) { changeList.AddRange(handheldList.GetAll()); } //move card from handheld to graveard foreach (ElementCardInstance item in changeList) { handheldList.RemoveItem(item); } player.Graveyard.AddItems(changeList); } }
private void Start() { var token = this.GetCancellationTokenOnDestroy(); linkedToken = CancellationTokenSource.CreateLinkedTokenSource(new CancellationToken(), token); playerInstance = FindObjectOfType <PlayerInstance>(); //GetTargetPlayer(token: token).Forget(); this.ObserveEveryValueChanged(x => x._playerManager.currentPlayerState) .Where(x => x == PlayerState.Diging || x == PlayerState.JoinOtherDig) .Subscribe(x => { //loadSceneCanvas.SetActive(true); Debug.Log("_playerManager" + _playerManager); Debug.Log("_playerManager.PlayerController" + _playerManager.PlayerController); //化石の遷移追加 Invoke(nameof(InsertLoadingScene), LoadingSceneTime); _playerManager.PlayerController.ForceFreeze(RigidbodyConstraints.FreezeAll); Initialization(); switch (x) { case PlayerState.Diging: InitFirstDigPlayer(linkedToken.Token); break; case PlayerState.JoinOtherDig: InitNextDigPlayer(playerManager.PlayerAction.talkedPlayer); break; } ClickAsync(linkedToken.Token).Forget(); }); }
public static void JungleClear() { if (Q.IsReady() && ModesMenu2["JungleQ"].Cast <CheckBox>().CurrentValue&& ObjectManager.Player.ManaPercent >= Program.ModesMenu2["ManaJ"].Cast <Slider>().CurrentValue) { var minions = EntityManager.MinionsAndMonsters.GetJungleMonsters(Player.Instance.Position, Q.Range).Where(t => !t.IsDead && t.IsValid && !t.IsInvulnerable); foreach (var m in minions) { if (Q.GetPrediction(m).CollisionObjects.Where(t => t.IsEnemy && !t.IsDead && t.IsValid && !t.IsInvulnerable).Count() >= minions.Count() - 1) { Q.Cast(m); break; } } } if (R.IsReady() && ModesMenu2["JungleR"].Cast <CheckBox>().CurrentValue&& ObjectManager.Player.ManaPercent >= Program.ModesMenu2["ManaJR"].Cast <Slider>().CurrentValue) { var minions = EntityManager.MinionsAndMonsters.GetJungleMonsters(Player.Instance.Position, Q.Range).Where(t => !t.IsDead && t.IsValid && !t.IsInvulnerable); if (minions.Count() > 0) { if (PlayerInstance.GetBuffCount("kogmawlivingartillerycost") < ModesMenu2["JRStack"].Cast <Slider>().CurrentValue) { R.Cast(minions.First()); } } } }
private static ReturnTypes ConditionBloodthirsty(PlayerInstance ch, int conditionValue) { var retcode = ReturnTypes.None; if (ch.Level >= LevelConstants.AvatarLevel) { return(retcode); } ch.SetColor(ATTypes.AT_BLOOD); var attrib = ConditionTypes.Bloodthirsty.GetAttribute <DescriptorAttribute>(); ch.SendTo(attrib.Messages.ToList()[conditionValue * 2]); if (conditionValue >= 2) { return(retcode); } comm.act(ATTypes.AT_HUNGRY, attrib.Messages.ToList()[conditionValue * 2 + 1], ch, null, null, ToTypes.Room); if (conditionValue == 0) { ch.WorsenMentalState(2); retcode = ch.CauseDamageTo(ch, ch.MaximumHealth / 20, (int)SkillNumberTypes.Undefined); } else { ch.WorsenMentalState(1); } return(retcode); }
private static string GetChannelText(ChannelTypes channelType, PlayerInstance ch) { var attrib = channelType.GetAttribute <ChannelAttribute>(); if (attrib == null) { throw new InvalidOperationException(); } var minTrust = 0; var trustAttrib = channelType.GetAttribute <RequireTrustChannelAttribute>(); if (trustAttrib != null) { minTrust = GameConstants.GetConstant <int>(trustAttrib.TrustType); } if (attrib.Verify(channelType, ch, minTrust)) { var print = channelType.GetAttribute <ChannelPrintAttribute>(); if (print == null) { throw new InvalidOperationException("ChannelPrint attribute missing from ChannelType"); } return(!ch.Deaf.IsSet(channelType) ? print.On : print.Off); } return(string.Empty); }
private void UpdatePlayerScores() { for (int i = 0; i < allPlayerScoreTexts.Count; i++) { if (i >= PlayerManager.instance.allConnectedPlayers.Count) { allPlayerScoreTexts[i].transform.parent.gameObject.SetActive(false); continue; } PlayerInstance playerInstance = PlayerManager.instance.allConnectedPlayers[i]; if (playerInstance == null) { Debug.Log("PlayerInstance could not be found on connection. So client disconnected but was not removed from list of all connected players"); allPlayerScoreTexts[i].transform.parent.gameObject.SetActive(false); continue; } allPlayerScoreTexts[i].SetText(playerInstance.ScreenName.screenName + " : " + playerInstance.Score.score); allPlayerScoreTexts[i].transform.parent.gameObject.SetActive(true); } StopAllCoroutines(); StartCoroutine(ResetLayoutGroup()); }
public static void AdjustFavor(this PlayerInstance ch, DeityFieldTypes field, int mod) { if (ch.IsNpc() || ch.PlayerData.CurrentDeity == null) { return; } var oldfavor = ch.PlayerData.Favor; var deity = ch.PlayerData.CurrentDeity; if ((ch.CurrentAlignment - deity.Alignment > 650) || (ch.CurrentAlignment - deity.Alignment < -650) && (deity.Alignment != 0)) { ch.PlayerData.Favor -= 2; ch.PlayerData.Favor = ch.PlayerData.Favor.GetNumberThatIsBetween(-2500, 2500); deity.UpdateCharacterBits(ch); ch.CheckForExtremeFavor(oldfavor); } else { ch.PlayerData.Favor += deity.FuzzifyFavor(field, mod < 1 ? 1 : mod); ch.PlayerData.Favor = ch.PlayerData.Favor.GetNumberThatIsBetween(-2500, 2500); } }
private void PlayerWeaponHitEnemy(WeaponEntity weapon, Skeleton enemy) { if (PlayerInstance.IsAttacking) { enemy.ReceiveDamage(PlayerInstance.GetEquippedWeapon().Damage); } }
/// <summary> /// Responde exactamente lo que dijo el jugador menos el input. /// </summary> /// <param name="controller"></param> /// <param name="separatedInputWords"></param> public override void RespondToInput(GameController controller, string[] separatedInputWords, string[] separatedCompleteInputWords) { playerToSpeakTo = null; if (separatedInputWords.Length <= 1) { controller.LogStringWithReturn("Ibas a decir algo pero te quedaste callado."); return; } separatedInputWords = CheckDifferentPossibilities(separatedInputWords); if (!playerToSpeakTo) { NetworkManager.Instance.SayThingInRoom(SayJustTheString(separatedInputWords), controller.playerManager.playerName); controller.LogStringWithReturn(SayExactString(separatedInputWords)); } else { if (controller.playerRoomNavigation.currentRoom.playersInRoom.Contains(playerToSpeakTo)) { NetworkManager.Instance.SayThingInRoomToPlayer(SayJustTheString(separatedInputWords), controller.playerManager.playerName, playerToSpeakTo.playerUserID); controller.LogStringWithReturn(SayExactString(separatedInputWords, playerToSpeakTo.playerName)); } else { controller.LogStringWithReturn(playerToSpeakTo.playerName + " no está en este lugar..."); } } }
protected override void SingletonAwake() { if (levelSetupInfo == null) { levelSetupInfo = LevelSetupInfo.DefaultLevelSetupInfo(); } soldierSpawnPoints = FindObjectsOfType <SpawnPoint>().ToList(); for (int i = 0; i < levelSetupInfo.numberOfPlayers; i++) { PlayerInstance player = new PlayerInstance(i, Database.PlayerInfos[i], Database.WeaponInformations.Clone()); if (levelSetupInfo.infiniteAmmo) { foreach (WeaponInformation w in player.weaponInformations.weapons) { w.usagesForStart = 999; } } players.Add(player); for (int j = 0; j < levelSetupInfo.numberOfCharacters; j++) { int randomSpawnPointNumber = Random.Range(0, soldierSpawnPoints.Count); CharacterSoldier soldier = Instantiate(characterSoldierPrefab, soldierSpawnPoints[randomSpawnPointNumber].transform.position, soldierSpawnPoints[randomSpawnPointNumber].transform.rotation).GetComponent <CharacterSoldier>(); soldier.transform.SetParent(charactersParent); soldierSpawnPoints.RemoveAt(randomSpawnPointNumber); player.soldiers.Add(soldier); soldier.playerInstance = player; } } }
void InitializeUI() { SpeedMeter.AttachTo(Camera.Main); SpeedMeter.RelativeZ = -40; // so that it's "in front" of the camera SpeedMeter.RelativeX = Camera.Main.OrthogonalWidth / 2.0f - (32 + SpeedMeter.mSpriteInstance.Width / 2); SpeedMeter.RelativeY = -(Camera.Main.OrthogonalHeight / 2.0f - (32 + SpeedMeter.mSpriteInstance.Height / 2)); SpeedMeter.SetCaseScale(5, -1, 3, 0); SpeedMeter.SetState(PlayerBoat.SpeedScale); ButtonPistolClick += (x) => { PlayerInstance.EquipItem(Weapon.ExistingWeapons.First(w => w.ItemName == "Pistol")); }; ButtonShotgunClick += (x) => { PlayerInstance.AddItemToInventory(Item.ExistingItems.First(y => y.ItemName == "Pistol")); PlayerInstance.AddItemToInventory(Item.ExistingItems.First(y => y.ItemName == "Sword")); }; FlatRedBallServices.IsWindowsCursorVisible = true; (InventoryGui.GetGraphicalUiElementByName("TextPlayerName") as GumRuntimes.TextRuntime).Text = PlayerInstance.PlayerName; InventoryGui.PlaceCasesInInventoryPanel(PlayerInstance.PlayerInventory.Length, 8); InventoryGui.OnItemMovedCase += InventoryGuiOnItemMoved; foreach (var box in InventoryBar.GetInventoryBoxList()) { box.Click += InventoryBarOnBoxClicked; } }
public override void ImplementHability(PlayerManager player, PlayerInstance enemy) { if (!isAvailable) { if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.controller.combatController.UpdatePlayerLog("Atraer no disponible."); return; } } base.ImplementHability(player, enemy); isAvailable = false; if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.currentTurn -= turnConsuption; player.controller.combatController.UpdatePlayerLog("¡Has usado Atraer!"); NetworkManager.Instance.UpdateEnemyLog(player.playerName + " te está atrayendo."); float damage = player.characteristics.currentStrength + Random.Range(1, 5) + 10; enemy.enemyStats.ReceiveDamage(damage, enemy); NetworkManager.Instance.ChangeEvasion(0, enemy); float r = Random.Range(0f, 1f); if (r <= 0.3f) { player.ChangeState(stateToChange); } } WaitForCooldown(); }
public static void reset_colors(PlayerInstance ch) { var path = SystemConstants.GetSystemDirectory(SystemDirectoryTypes.Color) + "default"; using (var proxy = new TextReaderProxy(new StreamReader(path))) { IEnumerable <string> lines = proxy.ReadIntoList(); foreach (var line in lines.Where(l => !l.EqualsIgnoreCase("#colortheme") && !l.StartsWithIgnoreCase("name") && !l.EqualsIgnoreCase("maxcolors"))) { var tuple = line.FirstArgument(); switch (tuple.Item1.ToLower()) { case "colors": var colors = tuple.Item2.Split(' '); for (var i = 0; i < colors.Length; i++) { ch.Colors[EnumerationExtensions.GetEnum <ATTypes>(i)] = (char)colors[i].ToInt32(); } break; case "end": return; } } } }
private static void ProcessChannelStatus(PlayerInstance ch, string argument, Action <CharacterInstance, ChannelTypes> clearAction, Action <CharacterInstance, ChannelTypes> verifyAction) { if (argument.EqualsIgnoreCase("all")) { foreach (var chType in ClearAllList) { clearAction.Invoke(ch, chType); } return; } var channelType = EnumerationExtensions.GetEnumByName <ChannelTypes>(argument); var attrib = channelType.GetAttribute <ChannelAttribute>(); if (attrib == null) { throw new InvalidOperationException(); } var minTrust = 0; var trustAttrib = channelType.GetAttribute <RequireTrustChannelAttribute>(); if (trustAttrib != null) { minTrust = GameConstants.GetConstant <int>(trustAttrib.TrustType); } if (attrib.Verify(channelType, ch, minTrust)) { verifyAction.Invoke(ch, channelType); } }
public override void ImplementHability(PlayerManager player, PlayerInstance enemy) { if (!isAvailable) { if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.controller.combatController.UpdatePlayerLog("Rastrear no disponible."); return; } } base.ImplementHability(player, enemy); isAvailable = false; if (GameState.Instance.CurrentState == GameState.GameStates.combat) { player.currentTurn -= turnConsuption; player.controller.combatController.UpdatePlayerLog("¡Has usado Rastrear!"); NetworkManager.Instance.UpdateEnemyLog(player.playerName + " te está rastreando."); NetworkManager.Instance.ChangeNewState(stateToChange.stateName, enemy); } WaitForCooldown(); }
public static void Combo() { var Target = TargetSelector.GetTarget(Q.Range, DamageType.Physical); if (Target == null) { return; } var useQ = ModesMenu1["ComboQ"].Cast <CheckBox>().CurrentValue; var useW = ModesMenu1["ComboYellowCard"].Cast <CheckBox>().CurrentValue; var Qp = Q.GetPrediction(Target); if (!Target.IsValid()) { return; } if (!_Player.HasBuff("Pick A Card Gold") && PlayerInstance.IsInAutoAttackRange(Target) && Q.IsReady() && useQ && Qp.HitChance >= HitChance.High) { Q.Cast(Target); } if (!PlayerInstance.IsInAutoAttackRange(Target) && Q.IsInRange(Target) && Q.IsReady() && useQ && Qp.HitChance >= HitChance.High) { Q.Cast(Qp.CastPosition); } if (Target.IsInRange(Target, 1000) && W.IsReady() && useW) { Common.CardSelector.StartSelecting(Common.Cards.Yellow); } }
public int getStsAndMakeInstance(int jinkei, int mapId, float mntMinusRatio, float seaMinusRatio, float rainMinusRatio, float snowMinusRatio){ String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoId = PlayerPrefs.GetInt(map); string busyoString = busyoId.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet (); int hp = sts.getHp (busyoId, lv); int atk = sts.getAtk (busyoId, lv); int dfc = sts.getDfc (busyoId, lv); int spd = sts.getSpd (busyoId, lv); string busyoName = sts.getBusyoName (busyoId); ArrayList senpouArray = sts.getSenpou (busyoId); //Map & Weather Minus string heisyu = sts.getHeisyu (busyoId); if (mntMinusRatio != 0) { if (heisyu == "KB") { float tmp = (float)spd * mntMinusRatio; if (tmp < 1) { tmp = 1; } spd = Mathf.FloorToInt (tmp); } }else if (seaMinusRatio != 0) { if (heisyu == "TP") { float tmp = (float)dfc * seaMinusRatio; if (tmp < 1) { tmp = 1; } dfc = Mathf.FloorToInt (tmp); }else if (heisyu == "YM") { float tmp = (float)dfc * seaMinusRatio; if (tmp < 1) { tmp = 1; } dfc = Mathf.FloorToInt (tmp); } } if (rainMinusRatio != 0) { if (heisyu == "TP") { float tmp = (float)atk * rainMinusRatio; if (tmp < 1) { tmp = 1; } atk = Mathf.FloorToInt (tmp); }else if (heisyu == "YM") { float tmp = (float)atk * rainMinusRatio; if (tmp < 1) { tmp = 1; } atk = Mathf.FloorToInt (tmp); } }else if(snowMinusRatio != 0) { float tmp = (float)spd * 0.5f; if (tmp < 1) { tmp = 1; } spd = Mathf.FloorToInt (tmp); if (heisyu == "TP") { float tmp2 = (float)atk * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } atk = Mathf.FloorToInt (tmp2); }else if (heisyu == "YM") { float tmp2 = (float)atk * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } atk = Mathf.FloorToInt (tmp2); }else if (heisyu == "KB") { float tmp2 = (float)dfc * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } dfc = Mathf.FloorToInt (tmp2); } } if (busyoId == soudaisyo) { soudaisyoHp = hp; soudaisyoAtk = atk; soudaisyoDfc = dfc; soudaisyoSpd = spd; } int boubi = 0; if (activeStageId == 0) { //Passive boubi = PlayerPrefs.GetInt("activeBoubi", 0); } //View Object & pass status to it. PlayerInstance inst = new PlayerInstance (); inst.makeInstance (busyoId, mapId, hp, atk, dfc, spd, senpouArray, busyoName, soudaisyo, boubi); return busyoId; }
void Start() { if (isLocalPlayer) { LocalPlayer = this; Debug.Log("local player created"); } else { _otherPlayers.Add(this); } debugMarker = GameObject.Find("debug marker"); }
void OnDestroy() { Debug.Log("Removing me from _otherPlayers"); _otherPlayers.Remove(this); LocalPlayer = null; }
public void getStsAndMakeInstance(int jinkei, int mapId){ String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoId = PlayerPrefs.GetInt(map); string busyoString = busyoId.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet (); int hp = sts.getHp (busyoId, lv); int atk = sts.getAtk (busyoId, lv); int dfc = sts.getDfc (busyoId, lv); int spd = sts.getSpd (busyoId, lv); string busyoName = sts.getBusyoName (busyoId); ArrayList senpouArray = sts.getSenpou (busyoId); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance (); inst.makeInstance (busyoId, mapId, hp, atk, dfc, spd, senpouArray, busyoName); }
public void playerEngunInstance(string playerEngunList){ List<string> daimyoEnguniList = new List<string> (); char[] delimiterChars = {':'}; char[] delimiterChars2 = {'-'}; if(playerEngunList.Contains(":")){ daimyoEnguniList = new List<string> (playerEngunList.Split (delimiterChars)); }else{ daimyoEnguniList.Add(playerEngunList); } for(int i=0; i<daimyoEnguniList.Count; i++){ string daimyoEngunString = daimyoEnguniList[i]; List<string> unitEnguniList = new List<string> (); unitEnguniList = new List<string> (daimyoEngunString.Split (delimiterChars2)); int busyoId = int.Parse(unitEnguniList[0]); if(busyoId!=0){ int busyoLv = int.Parse(unitEnguniList[1]); int butaiQty = int.Parse(unitEnguniList[2]); int butaiLv = int.Parse(unitEnguniList[3]); StatusGet sts = new StatusGet (); int hp = sts.getHp (busyoId, busyoLv); int atk = sts.getAtk (busyoId, busyoLv); int dfc = sts.getDfc (busyoId, busyoLv); int spd = sts.getSpd (busyoId, busyoLv); string busyoName = sts.getBusyoName (busyoId); ArrayList senpouArray = sts.getSenpou (busyoId); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance (); inst.makeEngunInstance(busyoId, hp, atk, dfc, spd, senpouArray, busyoName, butaiQty, butaiLv); } } Message msg = new Message (); string text = "自軍の援軍が到着しましたぞ!"; msg.makeKassenMessage (text); }
//doramatic charactor // Use this for initialization void Start() { //map生成 Instantiate(mapPrefab); Instantiate(treePrefab); Instantiate(wallPrefab); /*プレイヤー配置*/ //ユーザ陣形データのロード int jinkei =PlayerPrefs.GetInt("jinkei",0); //1.魚麟 if (jinkei == 1) { if(PlayerPrefs.HasKey("1map1")){ int mapId = 1; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map2")){ int mapId = 2; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map13")){ int mapId = 13; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map17")){ int mapId = 17; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map21")){ int mapId = 21; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map22")){ int mapId = 22; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } //2.鶴翼 }else if(jinkei == 2){ if(PlayerPrefs.HasKey("2map3")){ int mapId = 3; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map4")){ int mapId = 4; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map5")){ int mapId = 5; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map17")){ int mapId = 17; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map23")){ int mapId = 23; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map24")){ int mapId = 24; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } //3.偃月 else if(jinkei == 3){ if(PlayerPrefs.HasKey("3map3")){ int mapId = 3; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map9")){ int mapId = 9; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map15")){ int mapId = 15; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map16")){ int mapId = 16; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map20")){ int mapId = 20; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map21")){ int mapId = 21; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } //4.雁行 else if(jinkei == 4){ if(PlayerPrefs.HasKey("4map1")){ int mapId = 1; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map2")){ int mapId = 2; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map13")){ int mapId = 13; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map19")){ int mapId = 19; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map20")){ int mapId = 20; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map24")){ int mapId = 24; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } /*エネミー配置*/ //stageId取得しマスタ判別 int tempStageId = PlayerPrefs.GetInt("activeStageId",0); int kuniId = PlayerPrefs.GetInt("activeKuniId",0); Entity_stage_mst stageMst = Resources.Load ("Data/stage_mst") as Entity_stage_mst; //y=10(X-1)+z-1 int stageId = 10*(kuniId - 1) + tempStageId; int enemyJinkei = stageMst.param[stageId - 1].jinkei; int enemyLv = stageMst.param[stageId - 1].lv; int[] enemyArray = new int[25]; enemyArray[0] = stageMst.param[stageId - 1].map1; enemyArray[1] = stageMst.param[stageId - 1].map2; enemyArray[2] = stageMst.param[stageId - 1].map3; enemyArray[3] = stageMst.param[stageId - 1].map4; enemyArray[4] = stageMst.param[stageId - 1].map5; enemyArray[5] = stageMst.param[stageId - 1].map6; enemyArray[6] = stageMst.param[stageId - 1].map7; enemyArray[7] = stageMst.param[stageId - 1].map8; enemyArray[8] = stageMst.param[stageId - 1].map9; enemyArray[9] = stageMst.param[stageId - 1].map10; enemyArray[10] = stageMst.param[stageId - 1].map11; enemyArray[11] = stageMst.param[stageId - 1].map12; enemyArray[12] = stageMst.param[stageId - 1].map13; enemyArray[13] = stageMst.param[stageId - 1].map14; enemyArray[14] = stageMst.param[stageId - 1].map15; enemyArray[15] = stageMst.param[stageId - 1].map16; enemyArray[16] = stageMst.param[stageId - 1].map17; enemyArray[17] = stageMst.param[stageId - 1].map18; enemyArray[18] = stageMst.param[stageId - 1].map19; enemyArray[19] = stageMst.param[stageId - 1].map20; enemyArray[20] = stageMst.param[stageId - 1].map21; enemyArray[21] = stageMst.param[stageId - 1].map22; enemyArray[22] = stageMst.param[stageId - 1].map23; enemyArray[23] = stageMst.param[stageId - 1].map24; enemyArray[24] = stageMst.param[stageId - 1].map25; int ch_num = stageMst.param[stageId - 1].chQty; int ch_lv = stageMst.param[stageId - 1].lv; for(int i=0; i < enemyArray.Length; i++ ){ if(enemyArray[i] != 0){ int enemyMapId = i+1; int EnemyMap = enemyArray[i]; StatusGet sts = new StatusGet(); int hp = sts.getHp(EnemyMap,enemyLv); int atk = sts.getAtk(EnemyMap,enemyLv); int dfc = sts.getDfc(EnemyMap,enemyLv); int spd = sts.getSpd(EnemyMap,enemyLv); BusyoInfoGet info = new BusyoInfoGet(); String busyoName = info.getName(EnemyMap); String ch_type = info.getHeisyu(EnemyMap); EnemyInstance inst = new EnemyInstance(); inst.makeInstance(enemyMapId, EnemyMap, ch_lv, ch_type, ch_num, hp, atk, dfc, spd, busyoName); } } //HP bar //Instantiate(hpBarPlayerPrefab); //Instantiate(hpBarEnemyPrefab); //合戦開始エフェクト string pathBack = "Prefabs/PreKassen/backGround"; GameObject back = Instantiate(Resources.Load (pathBack)) as GameObject; back.transform.localScale = new Vector2 (30, 15); string pathLight = "Prefabs/PreKassen/lightning"; GameObject light = Instantiate(Resources.Load (pathLight)) as GameObject; light.transform.localScale = new Vector2 (10, 10); }