public static void loadDeck(int value) { store_deck.Clear(); Debug.Log("invoked"); if (PlayerPrefs.HasKey("extra_" + value)) { extraID = PlayerPrefs.GetString("extra_" + value); Debug.Log("extraLoad"); int i = 0; while (true) { if (!PlayerPrefs.HasKey("card_" + i + "_" + value)) { break; } else { store_deck.Add(PlayerPrefs.GetString("card_" + i + "_" + value)); } Debug.Log("cardLoad_index: " + i); i++; } GameObject.Find("DeckPanels").GetComponent <scr_deckPanel>().refresh(); GameObject extraEl = GameObject.Find("DExtraElement"); extraEl.GetComponent <scr_deckShowcard>().id = extraID; extraEl.transform.GetChild(0).GetComponent <Text>().text = (string)DB_card.getIdentity(extraID)[4]; } }
public void OnPointerEnter(PointerEventData eventData) { SpriteRenderer rend = gameObject.GetComponent <SpriteRenderer>(); scr_unit data = sav_parent.GetComponent <scr_unit>(); if (!data.isEnemy) { string checkEmerge = (string)DB_card.getIdentity(data.id)[5]; if (data.canAttack()) { rend.sprite = attack; rend.color = new Color(1f, 1f, 1f, 1f); } else if (checkEmerge.Contains("[능력") && emerge_flag) { if (data.canSpell()) { rend.sprite = magic; rend.color = new Color(1f, 1f, 1f, 1f); } } } onMouse = true; }
public void spawn(GameObject place) { ArrayList data = DB_card.getIdentity(scr_storeDeck.extraID); data.Add(scr_storeDeck.extraID); player.GetComponent <scr_playerController>().direct_informData(data, place.transform.localPosition); player.GetComponent <scr_playerInGame>().setCardSpawn(player, place.transform.localPosition, data); scr_guiController.extraFlag = false; Destroy(gameObject); }
public void refresh() { for (int i = 0; i <= 7; i++) { GameObject graph = GameObject.Find("TerialGraph_" + i); graph.GetComponent <RectTransform>().sizeDelta = new Vector2(60f, 0f); graph.transform.GetChild(0).gameObject.GetComponent <Text>().text = "0"; } foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Card")) { Destroy(cur); } foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Element")) { Destroy(cur); } GameObject insParent = GameObject.Find("DGridWithElements"); GameObject insParent2 = GameObject.Find("DGridWithSelections"); foreach (string id in DB_card.collectible) { if (checkTerial(id)) { GameObject ins = Instantiate(element, insParent.transform); ins.GetComponent <scr_deckShowcard>().id = id; ins.transform.GetChild(0).gameObject.GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; } } foreach (string id in scr_storeDeck.store_deck) { GameObject ins = Instantiate(element, insParent2.transform); ins.GetComponent <scr_deckShowcard>().id = id; ins.GetComponent <scr_deckShowcard>().inDeck = true; ins.transform.GetChild(0).gameObject.GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; int cost = (int)DB_card.getIdentity(id)[0]; GameObject graph = GameObject.Find("TerialGraph_" + cost); GameObject graphText = graph.transform.GetChild(0).gameObject; int graphAmount = Int32.Parse(graphText.GetComponent <Text>().text); if (graphAmount <= 15) { graph.GetComponent <RectTransform>().sizeDelta += new Vector2(0, 24f); } graphText.GetComponent <Text>().text = "" + (graphAmount + 1); } }
public void displayHand() { foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Card")) { Destroy(cur); } foreach (string cardId in hand) { int temp_rank = (int)DB_card.getIdentity(cardId)[3]; if (temp_rank == 3) { hand.Remove(cardId); } } while (hand.Count > 10) { hand.RemoveAt(hand.Count - 1); } int handCnt = hand.Count; int posX = 0; canvas = GameObject.Find("Canvas"); int expansion = 0; for (int it = 0; it < hand.Count; it++) { if (it == 0) { posX = 430 - 50 * handCnt; if (posX < 180) { posX = 180; } } else if (it == 5) { expansion = 1; posX = 430 - 50 * (handCnt - 5); } canvas.GetComponent <scr_canvas>().displayCard(card, (string)hand[it], posX, expansion); posX += 100; } }
public void turnEnd() { if (time > nextTime) { getPlayer(); bool check = localPlayer.GetComponent <scr_playerController>().myturn; if (getMeditator() && check) { if (isServer) { med.GetComponent <scr_meditator>().changeTurn(); foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit data = unit.GetComponent <scr_unit>(); string checkGrow = (string)DB_card.getIdentity(data.id)[5]; if (data.hosts && checkGrow.Contains("[성장")) { data.grow(); } } } else { localPlayer.GetComponent <scr_playerController>().direct_cmdrequest(); foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit data = unit.GetComponent <scr_unit>(); string checkGrow = (string)DB_card.getIdentity(data.id)[5]; if (!data.hosts && checkGrow.Contains("[성장")) { data.grow(); } } } nextTime = time + 100; } } }
public static void structureDeck() { int structDeck = GameObject.Find("DStructureDropdown").GetComponent <Dropdown>().value; store_deck.Clear(); switch (structDeck) { case 1: extraID = "TONUS"; store_deck.Add("volcanic_dragonling"); store_deck.Add("volcanic_dragonling"); store_deck.Add("volcanic_dragon"); store_deck.Add("volcanic_dragon"); store_deck.Add("volcanic_dragon"); store_deck.Add("volcanic_monster"); store_deck.Add("volcanic_monster"); store_deck.Add("volcanic_monster"); store_deck.Add("lava_swarm"); store_deck.Add("lava_swarm"); store_deck.Add("lava_swarm"); store_deck.Add("dragon_tamer"); store_deck.Add("dragon_tamer"); store_deck.Add("dragon_tamer"); store_deck.Add("Volcanic_twindragon"); store_deck.Add("little_firedragon"); store_deck.Add("little_firedragon"); store_deck.Add("little_firedragon"); store_deck.Add("knowledge_omniscence"); store_deck.Add("knowledge_omniscence"); store_deck.Add("#volcano"); store_deck.Add("#ador_breath"); store_deck.Add("#ador_breath"); store_deck.Add("#selfburn"); store_deck.Add("#heal_leaf"); store_deck.Add("#union_roar"); store_deck.Add("#union_roar"); store_deck.Add("#death"); break; case 2: extraID = "EURIEL"; store_deck.Add("raysen_fisherman"); store_deck.Add("raysen_fisherman"); store_deck.Add("triarodon_secretary"); store_deck.Add("triarodon_secretary"); store_deck.Add("triarodon_secretary"); store_deck.Add("little_mermaid"); store_deck.Add("little_mermaid"); store_deck.Add("little_mermaid"); store_deck.Add("waterdragon_son"); store_deck.Add("waterdragon_son"); store_deck.Add("waterdragon_priest"); store_deck.Add("waterdragon_priest"); store_deck.Add("waterpalace_guardian"); store_deck.Add("waterpalace_guardian"); store_deck.Add("waterpalace_guardian"); store_deck.Add("Triarodon"); store_deck.Add("#tales_river"); store_deck.Add("#tales_river"); store_deck.Add("#tales_river"); store_deck.Add("#salvage"); store_deck.Add("#salvage"); store_deck.Add("#blood_storm"); store_deck.Add("#nas_breath"); store_deck.Add("#nas_breath"); store_deck.Add("#death"); store_deck.Add("#ren_wakeup"); break; case 3: extraID = "NATIS"; store_deck.Add("barefoot_boy"); store_deck.Add("barefoot_boy"); store_deck.Add("barefoot_boy"); store_deck.Add("tina"); store_deck.Add("tina"); store_deck.Add("tina"); store_deck.Add("wind_rider"); store_deck.Add("wind_rider"); store_deck.Add("little_lion"); store_deck.Add("little_lion"); store_deck.Add("little_lion"); store_deck.Add("wind_walker"); store_deck.Add("wind_walker"); store_deck.Add("attack_eater"); store_deck.Add("attack_eater"); store_deck.Add("necky"); store_deck.Add("necky"); store_deck.Add("tornado_hero"); store_deck.Add("mitero"); store_deck.Add("Keiro"); store_deck.Add("#wisdom_eye"); store_deck.Add("#wisdom_eye"); store_deck.Add("#death"); store_deck.Add("#ren_wakeup"); break; case 4: extraID = "HETERO"; store_deck.Add("little_healer"); store_deck.Add("moon_slayer"); store_deck.Add("Revilla"); store_deck.Add("admired_bishop"); store_deck.Add("duret"); store_deck.Add("grail_maker"); store_deck.Add("alcadrobot_typeB"); store_deck.Add("Sytron"); store_deck.Add("Sardis"); store_deck.Add("expert_healer"); store_deck.Add("burying_socerer"); store_deck.Add("Resia"); store_deck.Add("#evolve:SaintResia"); store_deck.Add("#recall"); store_deck.Add("#blood_storm"); store_deck.Add("#emergency_deposit"); store_deck.Add("#emergency_deposit"); store_deck.Add("#heal_leaf"); store_deck.Add("#wisdom_eye"); store_deck.Add("#death"); store_deck.Add("#ren_wakeup"); break; case 5: extraID = "MACHINA"; store_deck.Add("sacrificer"); store_deck.Add("sacrificer"); store_deck.Add("sacrificer"); store_deck.Add("sacrificed_ghost"); store_deck.Add("sacrificed_ghost"); store_deck.Add("sacrificed_ghost"); store_deck.Add("jack-o-lantern"); store_deck.Add("jack-o-lantern"); store_deck.Add("tornado_hero"); store_deck.Add("sacrifice_summoner"); store_deck.Add("sacrifice_summoner"); store_deck.Add("wishful_bishop"); store_deck.Add("wishful_bishop"); store_deck.Add("dark_baron"); store_deck.Add("#widdy_breath"); store_deck.Add("#blood_storm"); store_deck.Add("#blood_storm"); store_deck.Add("#heal_leaf"); store_deck.Add("#heal_leaf"); store_deck.Add("#wisdom_eye"); store_deck.Add("#wisdom_eye"); break; case 6: extraID = "BT"; store_deck.Add("cave_guardian"); store_deck.Add("cave_guardian"); store_deck.Add("cave_guardian"); store_deck.Add("neprafti"); store_deck.Add("neprafti"); store_deck.Add("neprafti"); store_deck.Add("afterlife_guide"); store_deck.Add("afterlife_guide"); store_deck.Add("afterlife_guide"); store_deck.Add("Necropia"); store_deck.Add("Tenebera"); store_deck.Add("Pyrena"); store_deck.Add("dark_mage"); store_deck.Add("dark_mage"); store_deck.Add("#dark_token"); store_deck.Add("#dark_token"); store_deck.Add("#dark_token"); store_deck.Add("#grave_robber"); store_deck.Add("#grave_robber"); store_deck.Add("#dark_ora"); store_deck.Add("#dark_ora"); store_deck.Add("#dark_ora"); store_deck.Add("#emergency_deposit"); store_deck.Add("#emergency_deposit"); store_deck.Add("#ren_wakeup"); break; case 7: extraID = "BAN"; store_deck.Add("student_swordman"); store_deck.Add("student_swordman"); store_deck.Add("student_swordman"); store_deck.Add("student_fighter"); store_deck.Add("student_fighter"); store_deck.Add("student_fighter"); store_deck.Add("big_sworder"); store_deck.Add("big_sworder"); store_deck.Add("student_knight"); store_deck.Add("student_knight"); store_deck.Add("student_knight"); store_deck.Add("moon_slayer"); store_deck.Add("moon_slayer"); store_deck.Add("Revilla"); store_deck.Add("tough_shieldman"); store_deck.Add("tough_shieldman"); store_deck.Add("wind_rider"); store_deck.Add("wind_rider"); store_deck.Add("steel_sworder"); store_deck.Add("steel_sworder"); store_deck.Add("battlefield_commander"); store_deck.Add("battlefield_commander"); store_deck.Add("battlefield_commander"); store_deck.Add("mancy"); store_deck.Add("mancy"); store_deck.Add("#assembly"); store_deck.Add("#assembly"); store_deck.Add("#assembly"); store_deck.Add("#death"); break; case 8: extraID = "TONUS"; store_deck.Add("student_magician"); store_deck.Add("student_magician"); store_deck.Add("student_magician"); store_deck.Add("ancient_magician"); store_deck.Add("ancient_magician"); store_deck.Add("ancient_magician"); store_deck.Add("dimension_summoner"); store_deck.Add("dimension_summoner"); store_deck.Add("dimension_summoner"); store_deck.Add("alcadrobot_typeB"); store_deck.Add("alcadrobot_typeB"); store_deck.Add("violet"); store_deck.Add("violet"); store_deck.Add("knowledge_omniscence"); store_deck.Add("knowledge_omniscence"); store_deck.Add("#dimension_summon"); store_deck.Add("#dimension_summon"); store_deck.Add("#dimension_summon"); store_deck.Add("#recall"); store_deck.Add("#recall"); store_deck.Add("#wisdom_eye"); store_deck.Add("#wisdom_eye"); break; case 9: extraID = "BT"; store_deck.Add("kitten"); store_deck.Add("kitten"); store_deck.Add("kitten"); store_deck.Add("corpse_raven"); store_deck.Add("corpse_raven"); store_deck.Add("animal_lover"); store_deck.Add("animal_lover"); store_deck.Add("mild_bear"); store_deck.Add("mild_bear"); store_deck.Add("whitefur_fox"); store_deck.Add("soulful_icefox"); store_deck.Add("soulful_icefox"); store_deck.Add("little_lion"); store_deck.Add("little_lion"); store_deck.Add("Nyan"); store_deck.Add("longlife_turtle"); store_deck.Add("lion_tamer"); store_deck.Add("lion_tamer"); store_deck.Add("tigor"); store_deck.Add("tigor"); store_deck.Add("#recall"); store_deck.Add("#recall"); store_deck.Add("#wisdom_eye"); store_deck.Add("#death"); store_deck.Add("#ren_wakeup"); break; case 10: extraID = "LICA"; store_deck.Add("dollmaker"); store_deck.Add("dollmaker"); store_deck.Add("dollhugging_girl"); store_deck.Add("dollhugging_girl"); store_deck.Add("dollhugging_girl"); store_deck.Add("lary"); store_deck.Add("lary"); store_deck.Add("lary"); store_deck.Add("tetra"); store_deck.Add("tetra"); store_deck.Add("Sein"); store_deck.Add("mirat"); store_deck.Add("mirat"); store_deck.Add("#doll_gathering"); store_deck.Add("#doll_gathering"); store_deck.Add("#doll_gathering"); store_deck.Add("#doll_regression"); store_deck.Add("#doll_regression"); store_deck.Add("#doll_sacrifice"); store_deck.Add("#doll_sacrifice"); store_deck.Add("#wisdom_eye"); store_deck.Add("#wisdom_eye"); break; default: break; } GameObject.Find("DeckPanels").GetComponent <scr_deckPanel>().refresh(); GameObject extraEl = GameObject.Find("DExtraElement"); extraEl.GetComponent <scr_deckShowcard>().id = extraID; extraEl.transform.GetChild(0).GetComponent <Text>().text = (string)DB_card.getIdentity(extraID)[4]; }
public void OnEndDrag(PointerEventData eventData) { foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Player")) { gameObject.transform.SetParent(GameObject.Find("Canvas").transform); if (gameObject.GetComponent <SpriteRenderer>().sprite == attack) { if (!cur.GetComponent <scr_playerController>().isPlayer&& canDirectAttack() && transform.localPosition.y >= 360) { scr_unit data = sav_parent.GetComponent <scr_unit>(); data.CmdDirectattack_health_calculation(cur); if (data.id == "Falcifer") { data.CmdDamage(sav_parent, 2); data.Cmdcharge(); break; } break; } } } foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Unit")) { gameObject.transform.SetParent(GameObject.Find("Canvas").transform); if (gameObject.GetComponent <SpriteRenderer>().sprite == attack) { string checkRange = (string)DB_card.getIdentity(sav_parent.GetComponent <scr_unit>().id)[5]; if (cur.GetComponent <scr_unit>().isEnemy&& (checkRange.Contains("[원격") || canAttack(cur)) && Vector3.Distance(gameObject.transform.localPosition, cur.transform.localPosition) <= 60f) { scr_unit data = sav_parent.GetComponent <scr_unit>(); data.Cmdchange_spawn_turn(); string checkAttack = (string)DB_card.getIdentity(data.id)[5]; if (checkAttack.Contains("[공격")) { switch (data.id) { case "moon_slayer": data.CmdgetSelfStatus(1, 0); break; case "Revilla": data.CmdgetSelfStatus(cur.GetComponent <scr_unit>().health, 0); break; case "dollmaker": if (data.isMyturn()) { scr_playerInGame.hand.Add("doll"); } break; case "sacrifice_summoner": if (getPlayer()) { player.GetComponent <scr_playerIdentity>().CmdSetSacrificeCnt(data.hosts, 2); } break; case "wind_rider": if (cur.GetComponent <scr_unit>().attack >= 7) { data.CmdDamage(cur, cur.GetComponent <scr_unit>().health); } break; case "Volcanic_twindragon": if (cur.GetComponent <scr_unit>().health <= data.attack) { data.CmdgetSelfStatus(1, 1); data.Cmdcharge(); } break; case "mancy": data.CmdgetSelfStatus(2, 0); break; case "axe_zealot": if (getPlayer()) { if (player.GetComponent <scr_playerController>().myturn) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Unit")) { if (obj != gameObject) { data.CmdDamage(obj, 1); } } } } break; case "Falcifer": data.CmdDamage(sav_parent, 2); data.Cmdcharge(); break; case "mirat": if (getPlayer()) { if (player.GetComponent <scr_playerController>().myturn) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Unit")) { if (obj.GetComponent <scr_unit>().hosts == data.hosts && obj.GetComponent <scr_unit>().id == "doll") { data.CmdgetStatus(obj, 1, 1); } } } } break; case "Keiro": if (getPlayer()) { if (data.isMyturn()) { if (cur.GetComponent <scr_unit>().health <= data.attack) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player")) { if (!obj.GetComponent <scr_playerController>().isPlayer) { data.CmdDamage(obj, cur.GetComponent <scr_unit>().attack); } } } } } break; default: break; } } data.Cmdattack_health_calculation(cur); break; } } else if (gameObject.GetComponent <SpriteRenderer>().sprite == magic) { if ((Vector3.Distance(gameObject.transform.localPosition, cur.transform.localPosition) <= 60f) && cur != gameObject) { scr_unit data = sav_parent.GetComponent <scr_unit>(); requestParticle(3, sav_parent, -1); switch (data.id) { case "little_healer": data.CmdDamage(cur, -2); emerge_flag = false; break; case "student_swordman": data.CmdDamage(cur, 1); emerge_flag = false; break; case "shasha": data.CmdsetTerial(cur.GetComponent <scr_unit>().terial); emerge_flag = false; break; case "hero_helper": data.CmdgetStatus(cur, 1, 1); emerge_flag = false; break; case "corpse_raven": scr_unit curData = cur.GetComponent <scr_unit>(); if (data.hosts == curData.hosts && curData.card_tag.Contains("Beast")) { data.CmdDamage(cur, curData.health); if (getPlayer()) { player.GetComponent <scr_playerIdentity>().CmdGainCard(data.hosts, "draw"); } emerge_flag = false; } break; case "admired_bishop": curData = cur.GetComponent <scr_unit>(); if (data.hosts != curData.hosts) { if (data.isMyturn()) { scr_playerInGame.hand.Add(curData.id); } emerge_flag = false; } break; case "waterdragon_priest": curData = cur.GetComponent <scr_unit>(); if (data.hosts == curData.hosts && curData.card_tag.Contains("Water")) { data.CmdDamage(cur, curData.health); if (getPlayer()) { player.GetComponent <scr_playerIdentity>().CmdGainCard(data.hosts, "draw"); player.GetComponent <scr_playerIdentity>().CmdGainCard(data.hosts, "draw"); } emerge_flag = false; } break; case "little_mermaid": curData = cur.GetComponent <scr_unit>(); if (curData.card_tag.Contains("Water")) { data.CmdgetStatus(cur, 1, 1); emerge_flag = false; } break; case "slum_dancer": data.CmdgetStatus(cur, -2, 0); emerge_flag = false; break; case "attack_eater": curData = cur.GetComponent <scr_unit>(); bool temp_flag = false; foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Unit")) { if (obj != gameObject && obj.GetComponent <scr_unit>().card_tag.Contains("Wind")) { temp_flag = true; break; } } if (temp_flag) { int temp_curAttack = curData.attack; int temp_attack = data.attack; data.CmdgetSelfStatus(temp_curAttack - temp_attack, 0); data.CmdgetStatus(cur, temp_attack - temp_curAttack, 0); emerge_flag = false; } break; case "ground_follower": curData = cur.GetComponent <scr_unit>(); if (curData.hosts == data.hosts && curData.card_tag.Contains("Earth")) { curData.CmdgetSelfStatus(curData.health - curData.attack, 0); emerge_flag = false; } break; case "whitefur_fox": curData = cur.GetComponent <scr_unit>(); if (curData.hosts == data.hosts && curData.card_tag.Contains("Beast")) { data.CmdgetStatus(cur, 1, 1); emerge_flag = false; } break; case "juen": curData = cur.GetComponent <scr_unit>(); if (curData.hosts == data.hosts && curData.card_tag.Contains("Beast")) { curData.Cmdcharge(); emerge_flag = false; } break; case "Toxie": curData = cur.GetComponent <scr_unit>(); if (curData.health <= 2) { curData.CmdCamouflage("Devil-T_host"); emerge_flag = false; } break; case "steel_sworder": data.CmdDamage(cur, 2); emerge_flag = false; break; case "rein": data.CmdgetStatus(cur, 1 - cur.GetComponent <scr_unit>().attack, 0); emerge_flag = false; break; case "dark_baron": if (getPlayer()) { int temp_health = cur.GetComponent <scr_unit>().health; data.CmdDamage(player, temp_health); data.CmdDamage(cur, temp_health); } emerge_flag = false; break; case "mitero": curData = cur.GetComponent <scr_unit>(); if (curData.hosts == data.hosts && curData.card_tag.Contains("Wind")) { data.CmdDamage(cur, curData.health); emerge_flag = false; } if (!emerge_flag) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit objData = obj.GetComponent <scr_unit>(); if (data.hosts != objData.hosts && objData.attack >= 5) { data.CmdDamage(obj, objData.health); } } } break; case "Sein": getPlayer(); curData = cur.GetComponent <scr_unit>(); if (data.isMyturn()) { if (scr_playerInGame.hand.Contains("doll")) { scr_playerInGame.hand.Remove("doll"); scr_playerInGame.deck.Add("doll"); data.CmdDamage(cur, 2); } } break; case "Tenebera": data.CmdrequestParticleByVector(7, cur.transform.localPosition, -1); data.CmdDestroyUnit(cur); emerge_flag = false; break; case "dark_mage": data.CmdDamage(cur, 4); emerge_flag = false; break; case "burying_socerer": curData = cur.GetComponent <scr_unit>(); if (data.isMyturn()) { scr_playerInGame.hand.Add(curData.id); } data.CmdrequestParticleByVector(7, cur.transform.localPosition, -1); data.CmdDestroyUnit(cur); emerge_flag = false; break; case "tigor": curData = cur.GetComponent <scr_unit>(); if (curData.hosts == data.hosts && curData.card_tag.Contains("Beast")) { data.CmdgetStatus(cur, 3, 3); emerge_flag = false; } break; case "SENA": if (data.isMyturn()) { if (scr_playerInGame.hand.Count != 0) { data.CmdDamage(cur, 2); getPlayer(); player.GetComponent <scr_playerIdentity>().CmdSelectCard(data.hosts, data.id); } } break; case "BT": if (cur.GetComponent <scr_unit>().attack <= 5) { cur.GetComponent <scr_unit>().Cmdcharge(); } emerge_flag = false; break; default: break; } break; } } } gameObject.transform.position = savePos; drag = false; }
// Use this for initialization void Start() { GameObject insParent = GameObject.Find("DGridWithElements"); foreach (string id in DB_card.collectible) { GameObject ins = Instantiate(element, insParent.transform); ins.GetComponent <scr_deckShowcard>().id = id; ins.transform.GetChild(0).gameObject.GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; } for (int i = 1; i <= 3; i++) { if (PlayerPrefs.HasKey("name_" + i)) { GameObject.Find("DLoadButton_" + i).transform.GetChild(0).GetComponent <Text>().text = PlayerPrefs.GetString("name_" + i); } } Dropdown drp = terialFilter.GetComponent <Dropdown>(); sav_terialFilter = drp.value; drp.onValueChanged.AddListener(delegate { valueChange(terialFilter); }); drp = rankFilter.GetComponent <Dropdown>(); sav_rankFilter = drp.value; drp.onValueChanged.AddListener(delegate { valueChange(rankFilter); }); drp = abilFilter.GetComponent <Dropdown>(); sav_abilFilter = drp.value; drp.onValueChanged.AddListener(delegate { valueChange(abilFilter); }); drp = tagFilter.GetComponent <Dropdown>(); sav_tagFilter = drp.value; drp.onValueChanged.AddListener(delegate { valueChange(tagFilter); }); InputField inpf = searchFilter.GetComponent <InputField>(); sav_search = inpf.text; inpf.onValueChanged.AddListener(delegate { valueChange(searchFilter); }); refresh(); }
public bool checkTerial(string id) { string data_name = (string)DB_card.getIdentity(id)[4]; string data = (string)DB_card.getIdentity(id)[5]; string data_tag = (string)DB_card.getIdentity(id)[6]; bool flag = true; if (sav_search != null || sav_search != "") { if (!data_name.Contains(sav_search) && !data.Contains(sav_search)) { flag = false; } } if (flag) { switch (sav_terialFilter) { case 1: if ((int)DB_card.getIdentity(id)[0] > 1) { flag = false; } break; case 2: if ((int)DB_card.getIdentity(id)[0] != 2) { flag = false; } break; case 3: if ((int)DB_card.getIdentity(id)[0] != 3) { flag = false; } break; case 4: if ((int)DB_card.getIdentity(id)[0] != 4) { flag = false; } break; case 5: if ((int)DB_card.getIdentity(id)[0] != 5) { flag = false; } break; case 6: if ((int)DB_card.getIdentity(id)[0] < 6) { flag = false; } break; default: break; } } if (flag) { switch (sav_rankFilter) { case 1: if ((int)DB_card.getIdentity(id)[3] != 0) { flag = false; } break; case 2: if ((int)DB_card.getIdentity(id)[3] != 1) { flag = false; } break; case 3: if ((int)DB_card.getIdentity(id)[3] != 2) { flag = false; } break; default: break; } } if (flag) { switch (sav_abilFilter) { case 1: if (!data.Contains("[출격")) { flag = false; } break; case 2: if (!data.Contains("[능력")) { flag = false; } break; case 3: if (!data.Contains("[돌진")) { flag = false; } break; case 4: if (!data.Contains("[원격")) { flag = false; } break; case 5: if (!data.Contains("[성장")) { flag = false; } break; case 6: if (!data.Contains("[사망")) { flag = false; } break; default: break; } } if (flag) { switch (sav_tagFilter) { case 1: if (!id.Contains("#")) { flag = false; } break; case 2: if (!data_tag.Contains("Fire")) { flag = false; } break; case 3: if (!data_tag.Contains("Water")) { flag = false; } break; case 4: if (!data_tag.Contains("Wind")) { flag = false; } break; case 5: if (!data_tag.Contains("Earth")) { flag = false; } break; case 6: if (!data_tag.Contains("Shock")) { flag = false; } break; case 7: if (!data_tag.Contains("Saint")) { flag = false; } break; case 8: if (!data_tag.Contains("Dark")) { flag = false; } break; case 9: if (!data_tag.Contains("Dimension")) { flag = false; } break; case 10: if (!data_tag.Contains("Warrior")) { flag = false; } break; case 11: if (!data_tag.Contains("Mage")) { flag = false; } break; case 12: if (!data_tag.Contains("Archer")) { flag = false; } break; case 13: if (!data_tag.Contains("Dragon")) { flag = false; } break; case 14: if (!data_tag.Contains("Beast")) { flag = false; } break; case 15: if (!data_tag.Contains("God")) { flag = false; } break; case 16: if (!data_tag.Contains("Devil")) { flag = false; } break; default: break; } } return(flag); }
public bool checkExtra() { bool synthesize_firstIng = false; bool synthesize_secondIng = false; int overlay_count = 0; switch (scr_storeDeck.extraID) { case "PEIN": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0 && (unitData.id == "investigator_pein" || unitData.id == "synthesizer")) { if (synthesize_firstIng == false) { synthesize_firstIng = true; } else { synthesize_secondIng = true; } } } return(synthesize_firstIng && synthesize_secondIng); case "BAN": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.id == "moon_slayer") { synthesize_firstIng = true; } else if (unitData.id == "mancy") { synthesize_secondIng = true; } else if (unitData.id == "synthesizer") { if (!synthesize_firstIng) { synthesize_firstIng = true; } else { synthesize_secondIng = true; } } } } return(synthesize_firstIng && synthesize_secondIng); case "PAN": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.id == "slum_dancer") { synthesize_firstIng = true; } else if (unitData.id == "rein") { synthesize_secondIng = true; } else if (unitData.id == "synthesizer") { if (!synthesize_firstIng) { synthesize_firstIng = true; } else { synthesize_secondIng = true; } } } } return(synthesize_firstIng && synthesize_secondIng); case "NATIS": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.id == "wind_walker") { synthesize_firstIng = true; } else if (unitData.id == "necky") { synthesize_secondIng = true; } else if (unitData.id == "synthesizer") { if (!synthesize_firstIng) { synthesize_firstIng = true; } else { synthesize_secondIng = true; } } } } return(synthesize_firstIng && synthesize_secondIng); case "ROGER": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.id == "wave_fighter") { synthesize_firstIng = true; } else if (unitData.id == "ken") { synthesize_secondIng = true; } else if (unitData.id == "synthesizer") { if (!synthesize_firstIng) { synthesize_firstIng = true; } else { synthesize_secondIng = true; } } } } return(synthesize_firstIng && synthesize_secondIng); case "LATIEN": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.terial == 6) { overlay_count++; } } } return(overlay_count >= 2); case "SENA": foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit unitData = unit.GetComponent <scr_unit>(); if (unit.transform.localPosition.y < 0) { if (unitData.terial == 4) { overlay_count++; } } } return(overlay_count >= 2); case "BT": return(extraFlag && scr_playerInGame.tomb.Count >= 12); case "TONUS": foreach (string card in scr_playerInGame.deck) { if ((int)DB_card.getIdentity(card)[0] == 7) { synthesize_firstIng = true; break; } } return(extraFlag && synthesize_firstIng); case "LICA": return(extraFlag && scr_playerInGame.hand.Count <= 2); case "MACHINA": getPlayer(); return(localPlayer.GetComponent <scr_playerIdentity>().sacrificeCnt >= 20); case "EURIEL": return(extraFlag && (scr_playerInGame.deck.Contains("#elemental_book") || scr_playerInGame.hand.Contains("#elemental_book"))); case "INFINITAS": getPlayer(); return(extraFlag && localPlayer.GetComponent <scr_playerIdentity>().sacrificeCnt >= 10); case "SAYRUN": getPlayer(); return(localPlayer.GetComponent <scr_playerIdentity>().sacrificeCnt >= 5); case "HETERO": getPlayer(); bool temp_flag = true; ArrayList temp_deck = new ArrayList(); foreach (string cardId in scr_playerInGame.deck) { foreach (string compareId in temp_deck) { if (compareId == cardId) { temp_flag = false; break; } } if (!temp_flag) { break; } temp_deck.Add(cardId); } return(extraFlag && temp_flag); default: return(false); } }
public void reloadList(bool isDeck) { GameObject grid = GameObject.FindGameObjectWithTag("ShowList"); foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Element")) { Destroy(cur); } if (isDeck) { foreach (string id in scr_playerInGame.deck) { GameObject ins = Instantiate(element, grid.transform); ins.GetComponent <scr_deckShowcard>().id = id; ins.GetComponent <scr_deckShowcard>().inGame = true; ins.GetComponent <scr_deckShowcard>().inDeck = true; ins.transform.GetChild(0).gameObject.GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; } } else { foreach (string id in scr_playerInGame.tomb) { GameObject ins = Instantiate(element, grid.transform); ins.GetComponent <scr_deckShowcard>().id = id; ins.GetComponent <scr_deckShowcard>().inGame = true; ins.GetComponent <scr_deckShowcard>().inDeck = false; ins.transform.GetChild(0).gameObject.GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; } } }
public void selectEffect(string id, string code) { if (code == "DRAW") { scr_playerInGame.deck.Remove(id); scr_playerInGame.hand.Add(id); } else if (code == "GETHAND") { scr_playerInGame.hand.Add(id); } else if (code == "DISCARDHAND") { scr_playerInGame.hand.Remove(id); scr_playerInGame.tomb.Add(id); } else if (code == "DISCARDHANDTOSACRIFICE") { scr_playerInGame.hand.Remove(id); scr_playerInGame.tomb.Add(id); sacrificeCnt += (int)DB_card.getIdentity(id)[0]; } else if (code == "DRAWPANELTY_COSTDAMAGE") { scr_playerInGame.deck.Remove(id); scr_playerInGame.hand.Add(id); health -= (int)DB_card.getIdentity(id)[0]; } else if (code == "RECALL") { scr_playerInGame.tomb.Remove(id); scr_playerInGame.hand.Add(id); } else if (code == "SERIATODECK") { scr_playerInGame.hand.Remove(id); scr_playerInGame.deck.Add("Seria"); } else if (code == "REMOVE_CAMOUFLAGE") { scr_playerInGame.tomb.Remove(id); foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit curData = cur.GetComponent <scr_unit>(); if (curData.id == "pyren_zombie") { curData.CmdCamouflage(id); } } } else if (code == "CHANGETAG") { string tempTag = (string)DB_card.getIdentity(id)[6]; foreach (GameObject cur in GameObject.FindGameObjectsWithTag("Unit")) { scr_unit curData = cur.GetComponent <scr_unit>(); if (curData.hosts == GetComponent <scr_playerController>().isHost) { curData.CmdsetTag(tempTag); } } } else if (code == "ELEMENTALFIELD") { string tempTag = (string)DB_card.getIdentity(id)[6]; CmdSetEnvironment("$" + tempTag); } gameObject.GetComponent <scr_playerInGame>().displayHand(); }
public void RpcSelectCard(bool value, string id) { scr_playerController temp_data = gameObject.GetComponent <scr_playerController>(); if (value == temp_data.isHost && temp_data.isPlayer) { ArrayList table = new ArrayList(); switch (id) { case "volcanic_monster": foreach (string cardId in scr_playerInGame.deck) { string cardTag = (string)DB_card.getIdentity(cardId)[6]; if (cardTag.Contains("Fire")) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "DRAWPANELTY_COSTDAMAGE"); } break; case "dollhugging_girl": foreach (string cardId in scr_playerInGame.deck) { string cardName = (string)DB_card.getIdentity(cardId)[4]; string cardDesc = (string)DB_card.getIdentity(cardId)[5]; if (cardName.Contains("전투 인형") || cardDesc.Contains("전투 인형")) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "DRAW"); } break; case "cave_guardian": if (scr_playerInGame.hand.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(scr_playerInGame.hand, "DISCARDHAND"); } break; case "neprafti": for (int i = 0; i < 3; i++) { if (scr_playerInGame.deck.Count != 0) { int drawIndex = Random.Range(0, scr_playerInGame.deck.Count); table.Add(scr_playerInGame.deck[drawIndex]); scr_playerInGame.tomb.Add(scr_playerInGame.deck[drawIndex]); scr_playerInGame.deck.RemoveAt(drawIndex); } else { break; } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "RECALL"); } break; case "raysen_fisherman": int temp_cost = 2; if (environment == "tales_1") { temp_cost++; } else if (environment == "tales_2") { temp_cost += 2; } else if (environment == "tales_3") { temp_cost += 3; } foreach (string cardId in scr_playerInGame.tomb) { int cardCost = (int)DB_card.getIdentity(cardId)[0]; string cardTag = (string)DB_card.getIdentity(cardId)[6]; if (cardTag.Contains("Water") && cardCost <= temp_cost) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "RECALL"); } break; case "student_magician": foreach (string cardId in scr_playerInGame.hand) { if (!cardId.Contains("#")) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "CHANGETAG"); } break; case "pyren_zombie": foreach (string cardId in scr_playerInGame.tomb) { int cardCost = (int)DB_card.getIdentity(cardId)[0]; string cardTag = (string)DB_card.getIdentity(cardId)[6]; if (cardTag.Contains("Dark") && cardCost <= 4) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "REMOVE_CAMOUFLAGE"); } break; case "mild_bear": foreach (string cardId in scr_playerInGame.deck) { int cardCost = (int)DB_card.getIdentity(cardId)[0]; string cardTag = (string)DB_card.getIdentity(cardId)[6]; if (cardTag.Contains("Beast") && cardCost <= 3) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "DRAW"); } break; case "lion_tamer": table.Add("petree"); table.Add("juen"); table.Add("besto"); GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "GETHAND"); break; case "alcadrobot_typeA": foreach (string cardId in scr_playerInGame.deck) { if ((int)DB_card.getIdentity(cardId)[0] == 3) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "DRAW"); } break; case "alcadrobot_typeB": foreach (string cardId in scr_playerInGame.deck) { if ((int)DB_card.getIdentity(cardId)[0] == 4) { table.Add(cardId); } } if (table.Count != 0) { GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "DRAW"); } break; case "#latien_fantasia": if (scr_playerInGame.tomb.Count != 0) { int temp_index = Random.Range(0, scr_playerInGame.tomb.Count); scr_playerInGame.hand.Add(scr_playerInGame.tomb[temp_index]); scr_playerInGame.tomb.RemoveAt(temp_index); } break; case "#assembly": foreach (string cardId in scr_playerInGame.deck) { string temp_tag = (string)DB_card.getIdentity(cardId)[6]; if (temp_tag.Contains("Warrior") && (int)DB_card.getIdentity(cardId)[0] <= 4) { table.Add(cardId); } } for (int i = 0; i < 2; i++) { if (table.Count != 0) { int temp_index = Random.Range(0, table.Count); scr_playerInGame.hand.Add(table[temp_index]); scr_playerInGame.deck.Remove(table[temp_index]); } else { break; } } break; case "#salvage": foreach (string cardId in scr_playerInGame.tomb) { string temp_tag = (string)DB_card.getIdentity(cardId)[6]; if (temp_tag.Contains("Water")) { table.Add(cardId); } } if (table.Count != 0) { int temp_index = Random.Range(0, table.Count); scr_playerInGame.hand.Add(table[temp_index]); scr_playerInGame.tomb.Remove(table[temp_index]); } break; case "#dimension_summon": foreach (string cardId in DB_card.collectible) { if (!cardId.Contains("#")) { table.Add(cardId); } } scr_playerInGame.hand.Add(table[Random.Range(0, table.Count)]); break; case "#union_roar": foreach (string cardId in scr_playerInGame.tomb) { string temp_tag = (string)DB_card.getIdentity(cardId)[6]; if (temp_tag.Contains("Dragon") && (int)DB_card.getIdentity(cardId)[0] <= 4) { table.Add(cardId); } } for (int i = 0; i < 3; i++) { if (table.Count != 0) { int temp_index = Random.Range(0, table.Count); scr_playerInGame.hand.Add(table[temp_index]); scr_playerInGame.tomb.Remove(table[temp_index]); table.RemoveAt(temp_index); } else { break; } } scr_playerInGame.cardQueue.Enqueue("draw"); break; case "SENA": GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(scr_playerInGame.hand, "SERIATODECK"); break; case "TONUS": GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(scr_playerInGame.deck, "DRAW"); break; case "EURIEL": table.Add("ador"); table.Add("nas"); table.Add("widdy"); table.Add("glen"); table.Add("lumen"); table.Add("daki"); table.Add("karma"); table.Add("zic"); table.Add("rea"); table.Add("bao"); table.Add("spira"); table.Add("kaka"); table.Add("del"); GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(table, "ELEMENTALFIELD"); break; case "HETERO": GameObject.Find("Canvas").GetComponent <scr_canvas>().enableSelect(); GameObject.Find("SelectPanel").GetComponent <scr_select>().setTable(scr_playerInGame.tomb, "RECALL"); break; default: break; } table.Clear(); } }
public void OnPointerClick(PointerEventData eventData) { if (!inGame) { if (!flag) { scr_deckPanel deckData = deckPanel.GetComponent <scr_deckPanel>(); if (!inDeck && scr_storeDeck.store_deck.Count < 30) { int elementCnt = 0; int elementCntDelta = (int)DB_card.getIdentity(id)[3]; int insertIndex = -1; foreach (string curId in scr_storeDeck.store_deck) { if (curId == id) { elementCnt++; insertIndex = scr_storeDeck.store_deck.IndexOf(id); } } if (elementCnt < 3 - elementCntDelta) { if (insertIndex == -1) { scr_storeDeck.store_deck.Add(id); } else { scr_storeDeck.store_deck.Insert(insertIndex, id); } deckData.refresh(); if (ins != null) { Destroy(ins); } } } else { scr_storeDeck.store_deck.Remove(id); deckData.refresh(); if (ins != null) { Destroy(ins); } } } else { int getExIndex = extras.IndexOf(id); if (getExIndex == extras.Count - 1) { id = (string)extras[0]; } else { id = (string)extras[getExIndex + 1]; } transform.GetChild(0).GetComponent <Text>().text = (string)DB_card.getIdentity(id)[4]; scr_storeDeck.extraID = id; if (ins != null) { Destroy(ins); } ins = Instantiate(card, GameObject.Find("DDeckPanel").transform); ins.GetComponent <scr_cardGUI>().enabled = false; DB_card.setIdentity(ins, id, new Vector3(810f, -370f, 0), new Vector3(1.2f, 1.2f)); } } else { if (!inDeck) { switch (id) { case "Necropia": scr_playerInGame.hand.Add("Dead_Necropia"); scr_playerInGame.tomb.Remove("Necropia"); if (ins != null) { Destroy(ins); } reloadList(false); break; case "Keres": scr_playerInGame.hand.Add("Keres"); scr_playerInGame.tomb.Remove("Keres"); if (ins != null) { Destroy(ins); } reloadList(false); break; case "#grave_robber": foreach (string cardId in scr_playerInGame.tomb) { string cardTag = (string)DB_card.getIdentity(cardId)[6]; int cardCost = (int)DB_card.getIdentity(cardId)[0]; if (cardTag.Contains("Dark") && cardCost == 5) { scr_playerInGame.tomb.Remove(cardId); scr_playerInGame.hand.Add(cardId); break; } } scr_playerInGame.tomb.Remove("#grave_robber"); if (ins != null) { Destroy(ins); } reloadList(false); break; case "#dark_ora": ArrayList table = new ArrayList(); foreach (string cardId in scr_playerInGame.tomb) { string cardTag = (string)DB_card.getIdentity(cardId)[6]; int cardCost = (int)DB_card.getIdentity(cardId)[0]; if (cardTag.Contains("Dark") && cardCost <= 4) { table.Add(cardId); } } if (table.Count != 0) { int drawIndex = Random.Range(0, table.Count); scr_playerInGame.deck.Add(table[drawIndex]); } scr_playerInGame.tomb.Remove("#dark_ora"); if (ins != null) { Destroy(ins); } reloadList(false); break; case "#emergency_deposit": getPlayer().GetComponent <scr_playerIdentity>().CmdGainStatus( getPlayer().GetComponent <scr_playerController>().isHost, 2, 0); scr_playerInGame.tomb.Remove("#emergency_deposit"); if (ins != null) { Destroy(ins); } reloadList(false); break; case "soulful_icefox": while (true) { if (scr_playerInGame.tomb.Contains("kitten")) { getPlayer().GetComponent <scr_playerIdentity>().CmdGainStatus( getPlayer().GetComponent <scr_playerController>().isHost, 1, 0); scr_playerInGame.tomb.Remove("kitten"); } else { break; } } scr_playerInGame.tomb.Remove("soulful_icefox"); if (ins != null) { Destroy(ins); } reloadList(false); break; default: break; } } } }