예제 #1
0
 public static void ShowAvailableNames(Action <string> onSelected)
 {
     instance.DestroyOptions();
     Window_PickName.Show_Static();
     Window_PickName.AddOption_Static("Custom Name (Max Length 4)", () => { /* DISABLED */ });
     for (int i = 0; i < GameData.badNamesArray.Length; i++)
     {
         string badName = GameData.badNamesArray[i];
         if (GameData.IsNameAvailable(badName))
         {
             Window_PickName.AddOption_Static(badName, () => {
                 instance.Hide();
                 onSelected(badName);
             });
         }
     }
 }
예제 #2
0
    public void Start(Transform transform)
    {
        overmapFtnDewHandler = new OvermapFtnDewHandler();
        UIBlack.Show();
        StopOvermapRunning();
        Window_PickName.Show_Static();
        Window_PickName.AddOption_Static("Custom Name (Length 4)", () => { });
        foreach (string badName in GameData.badNamesArray)
        {
            Window_PickName.AddOption_Static(badName, () => { Debug.Log(badName); });
        }
        Window_PickName.Hide_Static();
        StartOvermapRunning();
        UIBlack.Hide();


        foreach (Character character in GameData.characterList)
        {
            if (character.isDead)
            {
                continue;
            }
            if (character.IsEnemy())
            {
                SpawnEnemy(character);
                continue;
            }

            switch (character.type)
            {
            case Character.Type.Player:
                playerOvermap.Setup(character);
                break;

            case Character.Type.Tank:
                if (character.subType == Character.SubType.Tank_BeforeJoin)
                {
                    // Before Tank joined, make him an NPC
                    SpawnNPC(character);
                }
                else
                {
                    // After Tank joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, 0));
                }
                break;

            case Character.Type.Sleezer:
                if (character.subType == Character.SubType.Sleezer_Friendly)
                {
                    // After Tank joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, -5));
                }
                break;

            case Character.Type.Healer:
                if (character.subType == Character.SubType.Healer_BeforeJoin)
                {
                    // Before Healer joined, make him an NPC
                    SpawnNPC(character);
                }
                else
                {
                    // After Healer joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, 0));
                }
                break;

            case Character.Type.PlayerDoppelganger:
            case Character.Type.Shop:
            case Character.Type.Randy:
            case Character.Type.TavernAmbush:
            case Character.Type.TavernAmbush_2:
            case Character.Type.TavernAmbush_3:
                SpawnNPC(character);
                break;

            case Character.Type.Villager_1:
            case Character.Type.Villager_2:
            case Character.Type.Villager_3:
            case Character.Type.Villager_4:
            case Character.Type.Villager_5:
                NPCOvermap npcOvermap = SpawnNPC(character);
                foreach (Transform child in transform.Find("Map"))
                {
                    if (Vector3.Distance(npcOvermap.GetPosition(), child.position) < 1f)
                    {
                        CharacterSetLastMoveDirData characterSetLastMoveDirData = child.GetComponent <CharacterSetLastMoveDirData>();
                        npcOvermap.SetLastMoveDir(characterSetLastMoveDirData.lastMoveDir);
                    }
                }
                break;
            }
        }


        foreach (Item item in GameData.itemList)
        {
            if (item.IsDestroyed())
            {
                continue;
            }
            SpawnItem(item);
        }

        //OvermapHandler.SpawnNPC(new Vector3(0, 70));

        // Starting state
        switch (GameData.state)
        {
        case GameData.State.Start:
            Cutscenes.Play_Start();
            break;

        case GameData.State.DefeatedHurtMeDaddy:
        case GameData.State.DefeatedHurtMeDaddy_2:
            Window_QuestPointer.Create(GetNPC(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(0, 10), Color.yellow, Color.yellow, crossSprite: GameAssets.i.s_ExclamationPoint);
            break;

        case GameData.State.DefeatedTank:
            Cutscenes.Play_Tank_AfterJoin();
            break;

        case GameData.State.SurvivedTavernAmbush:
            Cutscenes.Play_SurvivedTavernAmbush();
            break;

        case GameData.State.HealerJoined:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("shop").position, Color.white, Color.white);
            break;

        case GameData.State.LostToEvilMonster_1:
            playerOvermap.SetPosition(GameAssets.i.Map.Find("dungeonPlayer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Tank)).SetPosition(GameAssets.i.Map.Find("dungeonTank").position);
            GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).SetPosition(GameAssets.i.Map.Find("dungeonSleezer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Healer)).SetPosition(GameAssets.i.Map.Find("dungeonHealer").position);

            Cutscenes.Play_LostToEvilMonster_1();
            break;

        case GameData.State.MovingToEvilMonster_2:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_2").position, Color.white, Color.white);
            break;

        case GameData.State.LostToEvilMonster_2:
            playerOvermap.SetPosition(GameAssets.i.Map.Find("dungeonPlayer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Tank)).SetPosition(GameAssets.i.Map.Find("dungeonTank").position);
            GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).SetPosition(GameAssets.i.Map.Find("dungeonSleezer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Healer)).SetPosition(GameAssets.i.Map.Find("dungeonHealer").position);

            Cutscenes.Play_LostToEvilMonster_2();
            break;

        case GameData.State.MovingToEvilMonster_3:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_3").position, Color.white, Color.white);
            break;

        case GameData.State.DefeatedEvilMonster:
            Cutscenes.Play_DefeatedEvilMonster();
            break;
        }

        transform.Find("Map").Find("Hitboxes").Find("TavernEntryHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedTank));
        transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddyHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedHurtMeDaddy));
        transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddy2Hitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedHurtMeDaddy_2));
        transform.Find("Map").Find("Hitboxes").Find("CastleBlockageHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.LostToEvilMonster_2));

        transform.Find("Map").Find("VillagerBlocker").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedTank));

        transform.Find("Map").Find("Blockage").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.LostToEvilMonster_2));

        //transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddyHitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, 0);
        //transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddy2Hitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, 0);

        foreach (Transform hitboxTransform in transform.Find("Map").Find("Hitboxes"))
        {
            hitboxTransform.GetComponent <SpriteRenderer>().color = new Color(0, 0, 0, 0);
        }

        //transform.Find("Map").Find("Hitboxes").Find("CastleBlockageHitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, .5f);

        //Window_QuestPointer.Create(new Vector3(150, 0), Color.white, Color.white);
        //ChatBubble.Create(playerOvermap.transform, new Vector3(3.5f, 5), "Oh Sleezer! You're so silly!");
        //ChatBubble.Create(playerOvermap.transform, new Vector3(3.5f, 5), "Hihihi");
    }