Beispiel #1
0
    public Weapon_Bow GetWeapon_Bow(SpawnCode weaponCode, GameObject _child)
    {
        if (!unlock.CheckCode(weaponCode))
        {
            return(null);
        }

        Base_Weapon dump = _child.GetComponent <Base_Weapon>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Weapon_Bow tmp;

        switch (weaponCode)
        {
        case SpawnCode.W201: tmp = _child.AddComponent <Bow_Default>(); break;

        case SpawnCode.W202: tmp = _child.AddComponent <Bow_NoMoney>(); break;

        case SpawnCode.W203: tmp = _child.AddComponent <Bow_Dryed>(); break;

        case SpawnCode.W204: tmp = _child.AddComponent <Bow_Long>(); break;

        case SpawnCode.W205: tmp = _child.AddComponent <Bow_Apollo>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #2
0
    //해당 코드를 언락함.
    public void UnlockCode(SpawnCode code)
    {
        //이미 언락이 되어 있다면 막기
        if (list.Contains(code))
        {
            return;
        }

        //리스트 올리고 서버에 통신
        list.Add(code);

        string str = code.ToString().Substring(0, 1);

        switch (str)
        {
        case "R":
        case "G":
        case "B":
            router.PostRouter(PostType.PLAYER_SKILL_UNLOCK, code); break;

        case "W":
            router.PostRouter(PostType.PLAYER_WEAPON_UNLOCK, code); break;

        case "A":
            router.PostRouter(PostType.PLAYER_AMULET_UNLOCK, code); break;

        case "S":
            router.PostRouter(PostType.PLAYER_STONE_UNLOCK, code); break;
        }
    }
Beispiel #3
0
    public Weapon_Spear GetWeapon_Spear(SpawnCode weaponCode, GameObject _child)
    {
        if (!unlock.CheckCode(weaponCode))
        {
            return(null);
        }

        Weapon_Spear dump = _child.GetComponent <Weapon_Spear>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Weapon_Spear tmp;

        switch (weaponCode)
        {
        case SpawnCode.W101: tmp = _child.AddComponent <Spear_Default>(); break;

        case SpawnCode.W102: tmp = _child.AddComponent <Spear_IceNalchi>(); break;

        case SpawnCode.W103: tmp = _child.AddComponent <Spear_Nyan>(); break;

        case SpawnCode.W104: tmp = _child.AddComponent <Spear_DangPa>(); break;

        case SpawnCode.W105: tmp = _child.AddComponent <Spear_PolarStar>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #4
0
    public Weapon_Sword GetWeapon_Sword(SpawnCode weaponCode, GameObject _child)
    {
        if (!unlock.CheckCode(weaponCode))
        {
            return(null);
        }

        Weapon_Sword dump = _child.GetComponent <Weapon_Sword>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Weapon_Sword tmp;

        switch (weaponCode)
        {
        case SpawnCode.W001: tmp = _child.AddComponent <Sword_Default>(); break;

        case SpawnCode.W002: tmp = _child.AddComponent <Sword_HotTuna>(); break;

        case SpawnCode.W003: tmp = _child.AddComponent <Sword_BBQStick>(); break;

        case SpawnCode.W004: tmp = _child.AddComponent <Sword_Broad>(); break;

        case SpawnCode.W005: tmp = _child.AddComponent <Sword_MoonLight>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #5
0
    public Skill_Blue GetSkill_Blue(SpawnCode skillcode, GameObject _child)
    {
        if (!unlock.CheckCode(skillcode))
        {
            return(null);
        }

        Skill_Blue dump = _child.GetComponent <Skill_Blue>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Skill_Blue tmp;

        switch (skillcode)
        {
        case SpawnCode.B001: tmp = _child.AddComponent <Skill_Blue_Barrier>(); break;

        case SpawnCode.B002: tmp = _child.AddComponent <Skill_Blue_Wall>(); break;

        case SpawnCode.B003: tmp = _child.AddComponent <Skill_Blue_Invisible>(); break;

        case SpawnCode.B004: tmp = _child.AddComponent <Skill_Blue_Shield>(); break;

        case SpawnCode.B005: tmp = _child.AddComponent <Skill_Blue_DefenceBuff>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #6
0
    public Skill_Red GetSkill_Red(SpawnCode skillcode, GameObject _child)
    {
        if (!unlock.CheckCode(skillcode))
        {
            return(null);
        }

        Skill_Red dump = _child.GetComponent <Skill_Red>();

        if (dump != null)
        {
            Destroy(dump);
        }


        Skill_Red tmp;

        switch (skillcode)
        {
        case SpawnCode.R001: tmp = _child.AddComponent <Skill_Red_PiercingSpear>(); break;

        case SpawnCode.R002: tmp = _child.AddComponent <Skill_Red_ArrowRain>(); break;

        case SpawnCode.R003: tmp = _child.AddComponent <Skill_Red_SwordTrap>(); break;

        case SpawnCode.R004: tmp = _child.AddComponent <Skill_Red_Turret>(); break;

        case SpawnCode.R005: tmp = _child.AddComponent <Skill_Red_PowerBuff>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #7
0
    public Skill_Green GetSkill_Green(SpawnCode skillcode, GameObject _child)
    {
        if (!unlock.CheckCode(skillcode))
        {
            return(null);
        }

        Skill_Green dump = _child.GetComponent <Skill_Green>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Skill_Green tmp;

        switch (skillcode)
        {
        case SpawnCode.G001: tmp = _child.AddComponent <Skill_Green_HighJump>(); break;

        case SpawnCode.G002: tmp = _child.AddComponent <Skill_Green_Dash>(); break;

        case SpawnCode.G003: tmp = _child.AddComponent <Skill_Green_BackStep>(); break;

        case SpawnCode.G004: tmp = _child.AddComponent <Skill_Green_Charger>(); break;

        case SpawnCode.G005: tmp = _child.AddComponent <Skill_Green_MoveBuff>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #8
0
    public Armor_Stone GetArmor_Stone(SpawnCode armorCode, GameObject _child)
    {
        if (!unlock.CheckCode(armorCode))
        {
            return(null);
        }

        Armor_Stone dump = _child.GetComponent <Armor_Stone>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Armor_Stone tmp;

        switch (armorCode)
        {
        case SpawnCode.S001: tmp = _child.AddComponent <Stone_Default>(); break;

        case SpawnCode.S002: tmp = _child.AddComponent <Stone_Magnetic>(); break;

        case SpawnCode.S003: tmp = _child.AddComponent <Stone_Guardian>(); break;

        case SpawnCode.S004: tmp = _child.AddComponent <Stone_Minor>(); break;

        case SpawnCode.S005: tmp = _child.AddComponent <Stone_Major>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #9
0
    public bool ChangeWeapon(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //장비 생성 & 할당
        string what = (code.ToString().Substring(0, 2));

        switch (what)
        {
        case "W0": spawn.GetWeapon_Sword(code, _child); break;

        case "W1": spawn.GetWeapon_Spear(code, _child); break;

        case "W2": spawn.GetWeapon_Bow(code, _child); break;
        }

        //무기 메커니즘 초기화
        _parents.GetComponent <PlayerStatus>().Init_Weapon();

        //서버 통신
        router.PostRouter(PostType.PLAYER_WEAPON_CHANGE, code);

        return(true);
    }
Beispiel #10
0
    public bool ChangeArmor(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //캐릭터 스테이터스 초기화
        PlayerStatus ps = _parents.GetComponent <PlayerStatus>();

        ps.Init_HpDefence();

        //장비 생성 & 할당, 서버 통신
        Base_Armor ar;
        string     what = (code.ToString().Substring(0, 1));

        switch (what)
        {
        case "A":
            ar = spawn.GetArmor_Amulet(code, _child);
            ar.Execute(ps);
            router.PostRouter(PostType.PLAYER_AMULET_CHANGE, code);
            break;

        case "S":
            ar = spawn.GetArmor_Stone(code, _child);
            ar.Execute(ps);
            router.PostRouter(PostType.PLAYER_STONE_CHANGE, code);
            break;
        }

        return(true);
    }
Beispiel #11
0
    public Armor_Amulet GetArmor_Amulet(SpawnCode armorCode, GameObject _child)
    {
        if (!unlock.CheckCode(armorCode))
        {
            return(null);
        }

        Armor_Amulet dump = _child.GetComponent <Armor_Amulet>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Armor_Amulet tmp;

        switch (armorCode)
        {
        case SpawnCode.A001: tmp = _child.AddComponent <Amulet_Default>(); break;

        case SpawnCode.A002: tmp = _child.AddComponent <Amulet_Richness>(); break;

        case SpawnCode.A003: tmp = _child.AddComponent <Amulet_Drain>(); break;

        case SpawnCode.A004: tmp = _child.AddComponent <Amulet_ImproveSkill>(); break;

        case SpawnCode.A005: tmp = _child.AddComponent <Amulet_PainPatch>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #12
0
    public bool ChangeSkill(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //스킬 생성 & 할당
        string what = (code.ToString().Substring(0, 1));

        switch (what)
        {
        case "R": spawn.GetSkill_Red(code, _child); break;

        case "G": spawn.GetSkill_Green(code, _child); break;

        case "B": spawn.GetSkill_Blue(code, _child); break;
        }

        //스킬 메커니즘 초기화
        _parents.GetComponent <PlayerStatus>().Init_Skill();

        //서버 통신
        router.PostRouter(PostType.PLAYER_SKILL_CHANGE, code);

        return(true);
    }
Beispiel #13
0
    public BaseFood GetFood(SpawnCode foodcode, GameObject _child)
    {
        if (!unlock.CheckCode(foodcode))
        {
            return(null);
        }

        BaseFood dump = _child.GetComponent <BaseFood>();

        if (dump != null)
        {
            Destroy(dump);
        }

        BaseFood tmp;

        switch (foodcode)
        {
        case SpawnCode.F001: tmp = _child.AddComponent <Food_Hamburger>(); break;

        case SpawnCode.F002: tmp = _child.AddComponent <Food_Pizza>(); break;

        case SpawnCode.F003: tmp = _child.AddComponent <Food_Noodle>(); break;

        case SpawnCode.F004: tmp = _child.AddComponent <Food_RiceBall>(); break;

        case SpawnCode.F005: tmp = _child.AddComponent <Food_Steak>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Beispiel #14
0
    public override void DropItem() //Only Boss!
    {
        DropItemObject.GetComponent <DroppedItem>().dropItemCode = myMonsterInfo.monsterDropItemCode;

        //-----------------------------------아이템 드랍-----------------------------------
        DroppedItem item = Instantiate(DropItemObject).GetComponent <DroppedItem>();

        SpawnCode mDropItemCode = myMonsterInfo.monsterDropItemCode;

        item.name = myMonsterInfo.monsterName + " 드롭 아이템:" + mDropItemCode.ToString();

        int ranX = Random.Range(-100, 101);     //min ~ max-1
        int ranY = Random.Range(100, 201);      //min ~ max-1

        item.transform.position = GetComponent <Transform>().position;
        item.GetComponent <Rigidbody2D>().AddForce(new Vector3(ranX, ranY, 0));              //위 방향으로 랜덤 발사
    }
Beispiel #15
0
    //생성자
    public MonsterInfo(MonsterCode monstercode, bool isb, string name, MonsterState state,
                       int damage, int defense, int hp, int speed, int range,
                       int goldamount, int droprate, SpawnCode dropitemcode)
    {
        monsterCode  = monstercode;
        isBoss       = isb;
        monsterName  = name;
        monsterState = state;

        monsterDamage      = damage;
        monsterDefense     = defense;
        monsterHp          = hp;
        monsterSpeed       = speed;
        monsterAttackRange = range;

        monsterDropGoldAmount = goldamount;
        monsterDropRate       = droprate;
        monsterDropItemCode   = dropitemcode;
    }
Beispiel #16
0
    public string complete_script;              //퀘스트 완료대사


    //생성자
    //퀘스트 고유 번호 str, 퀘스트 고유 번호, npc 고유 번호,  챕터,  퀘스트 상태,  퀘스트 유형, 몬스터 코드, 퀘스트 대상 완료 개수, 퀘스트 보상 유형, 퀘스트 진행개수, 퀘스트 이름,  퀘스트 내용, 퀘스트 요약, 퀘스트 대사
    public QuestInfo(string _quest_code_str, int _quest_code, int _quest_npc_code, int _quest_chapter, QuestState _quest_state, QuestType _quest_type, MonsterCode _quest_monstercode, int _quest_complete_count, QuestRewardCode _quest_reward_type, int _quest_reward_gold, SpawnCode _quest_reward_item, int _questItemCur, string _quest_name, string _content, string _summary, string _script, string _complete_script)
    {
        quest_code_str    = _quest_code_str;
        quest_code        = _quest_code;
        quest_npc_code    = _quest_npc_code;
        quest_chapter     = _quest_chapter;
        quest_state       = _quest_state;
        quest_type        = _quest_type;
        questmonstercode  = _quest_monstercode;
        questItemMax      = _quest_complete_count;
        quest_reward_type = _quest_reward_type;
        quest_reward_gold = _quest_reward_gold;
        quest_reward_item = _quest_reward_item;
        questItemCur      = _questItemCur;
        quest_name        = _quest_name;
        content           = _content;
        summary           = _summary;
        script            = _script;
        complete_script   = _complete_script;
    }
Beispiel #17
0
    public bool ChangeFood(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //음식 생성 & 할당
        string what = (code.ToString().Substring(0, 1));

        switch (what)
        {
        case "F": spawn.GetFood(code, _child); break;
        }

        //음식 효과 적용
        _parents.GetComponent <PlayerStatus>().Init_Food();

        return(true);
    }
Beispiel #18
0
    //해당 코드의 아이템이 언락이 되어있는지 확인함
    public bool CheckCode(SpawnCode code)
    {
        bool b = list.Contains(code);

        return(b);
    }
Beispiel #19
0
    public Sprite GetSource(SpawnCode code)
    {
        SpriteSource s = null;

        switch (code)
        {
        case SpawnCode.W001:
        case SpawnCode.W002:
        case SpawnCode.W003:
        case SpawnCode.W004:
        case SpawnCode.W005:
            s = Array.Find(weapon_sword, tmp => tmp.code == code); break;

        case SpawnCode.W101:
        case SpawnCode.W102:
        case SpawnCode.W103:
        case SpawnCode.W104:
        case SpawnCode.W105:
            s = Array.Find(weapon_spear, tmp => tmp.code == code); break;

        case SpawnCode.W201:
        case SpawnCode.W202:
        case SpawnCode.W203:
        case SpawnCode.W204:
        case SpawnCode.W205:
            s = Array.Find(weapon_bow, tmp => tmp.code == code); break;

        case SpawnCode.R001:
        case SpawnCode.R002:
        case SpawnCode.R003:
        case SpawnCode.R004:
        case SpawnCode.R005:
            s = Array.Find(skill_red, tmp => tmp.code == code); break;

        case SpawnCode.G001:
        case SpawnCode.G002:
        case SpawnCode.G003:
        case SpawnCode.G004:
        case SpawnCode.G005:
            s = Array.Find(skill_green, tmp => tmp.code == code); break;

        case SpawnCode.B001:
        case SpawnCode.B002:
        case SpawnCode.B003:
        case SpawnCode.B004:
        case SpawnCode.B005:
            s = Array.Find(skill_blue, tmp => tmp.code == code); break;


        case SpawnCode.A001:
        case SpawnCode.A002:
        case SpawnCode.A003:
        case SpawnCode.A004:
        case SpawnCode.A005:
            s = Array.Find(armor_Amulet, tmp => tmp.code == code); break;

        case SpawnCode.S001:
        case SpawnCode.S002:
        case SpawnCode.S003:
        case SpawnCode.S004:
        case SpawnCode.S005:
            s = Array.Find(armor_Stone, tmp => tmp.code == code); break;

        case SpawnCode.F001:
        case SpawnCode.F002:
        case SpawnCode.F003:
        case SpawnCode.F004:
        case SpawnCode.F005:
            s = Array.Find(food, tmp => tmp.code == code); break;
        }

        if (s == null)
        {
            Debug.LogWarning("SpriteSupplier: " + code.ToString() + " does not found!");
            return(null);
        }

        return(s.source);
    }
Beispiel #20
0
 public bool GetIsUnlocked(SpawnCode code)
 {
     return(unlock.CheckCode(code));
 }
Beispiel #21
0
 public void UnlockCode(SpawnCode code, int durability = 100)
 {
     unlock.UnlockCode(code);
     dict.Add(code, durability);
 }
Beispiel #22
0
 public void UnlockCode(SpawnCode code)
 {
     spawn.UnlockCode(code);
 }