Exemplo n.º 1
0
    /// <summary>
    /// 버튼의 image와 text를 해당 npc에 맞게 교체
    /// </summary>
    public void OpenButton(Npc npcData)
    {
        npcname = npcData.npcName;
        npccode = npcData.npcCode;

        characterName.text    = npcname;
        characterImage.sprite = Resources.Load <Sprite>("UI/npc icon/" + ((int)npccode).ToString()) as Sprite;
    }
Exemplo n.º 2
0
    public void OnDetailUI(NPCCode npccode, string npcname)
    {
        if (!detailActive)
        {
            detailActive = true;

            detailView.SetActive(detailActive);

            detailNameText.text    = npcname;
            detailContentText.text = npcExplains[(int)npccode];
            detailImage.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/npc icon/" + ((int)npccode).ToString()) as Sprite;
        }
    }
Exemplo n.º 3
0
 /// <summary>
 /// npcActive를 true로 변경
 /// </summary>
 /// <param name="npccode"></param>
 public void SetNpcActive(NPCCode npccode)
 {
     npcActive[(int)npccode] = true;
 }
Exemplo n.º 4
0
 public static async Task <List <Point> > GetPathToNPC(this IPathingService pathingService, Game game, NPCCode NPCCode, MovementMode movementMode)
 {
     return(await pathingService.GetPathToNPC(game.MapId, Difficulty.Normal, game.Area, game.Me.Location, NPCCode, movementMode));
 }
Exemplo n.º 5
0
 public void OpenButtonMain()
 {
     npcname = "주인공";
     npccode = NPCCode.MAIN;
 }
Exemplo n.º 6
0
 public static WorldObject GetUniqueNPC(Game game, NPCCode npcCode)
 {
     return(game.GetNPCsByCode(npcCode).FirstOrDefault());
 }
        public async Task <List <Point> > GetPathToNPC(uint mapId, Difficulty difficulty, Area area, Point fromLocation, NPCCode npcCode,
                                                       MovementMode movementMode)
        {
            var map = await _mapApiService.GetArea(mapId, difficulty, area);

            if (map.Npcs.TryGetValue((int)npcCode, out var points) && points.Count > 0)
            {
                return(GetPath(mapId, difficulty, area, map, movementMode, fromLocation, points.First()));
            }

            return(new List <Point>());
        }
Exemplo n.º 8
0
 // Methods
 public AssignNPC(byte[] data)
     : base(data)
 {
     this.uid = BitConverter.ToUInt32(data, 1);
     this.id = (NPCCode) BitConverter.ToUInt16(data, 5);
     this.x = BitConverter.ToUInt16(data, 7);
     this.y = BitConverter.ToUInt16(data, 9);
     this.life = data[11];
 }
Exemplo n.º 9
0
 // Methods
 public AssignMerc(byte[] data)
     : base(data)
 {
     this.id = (NPCCode) BitConverter.ToUInt16(data, 2);
     this.ownerUID = BitConverter.ToUInt32(data, 4);
     this.uid = BitConverter.ToUInt32(data, 8);
 }
Exemplo n.º 10
0
        // Methods
        public InformationMessage(byte[] data)
            : base(data)
        {
            this.slayerType = UnitType.NotApplicable;
            this.charClass = CharacterClass.NotApplicable;
            this.slayerObject = GameObjectID.NotApplicable;
            this.slayerMonster = NPCCode.NotApplicable;
            this.informationType = PlayerInformationActionType.None;
            this.relationType = PlayerRelationActionType.NotApplicable;
            this.amount = -1;
            this.type = (InformationMessageType) data[1];
            this.actionType = data[2];
            switch (this.type)
            {
                case InformationMessageType.DroppedFromGame:
                case InformationMessageType.JoinedGame:
                case InformationMessageType.LeftGame:
                    this.subjectName = ByteConverter.GetNullString(data, 8);
                    this.objectName = ByteConverter.GetNullString(data, 0x18);
                    return;

                case ((InformationMessageType) 1):
                case ((InformationMessageType) 5):
                    break;

                case InformationMessageType.NotInGame:
                    this.subjectName = ByteConverter.GetNullString(data, 8);
                    return;

                case InformationMessageType.PlayerSlain:
                    this.slayerType = (UnitType) data[7];
                    this.subjectName = ByteConverter.GetNullString(data, 8);
                    if (this.slayerType != UnitType.Player)
                    {
                        if (this.slayerType == UnitType.NPC)
                        {
                            this.slayerMonster = (NPCCode) BitConverter.ToUInt32(data, 3);
                            return;
                        }
                        if (this.slayerType == UnitType.GameObject)
                        {
                            this.slayerObject = (GameObjectID) BitConverter.ToUInt32(data, 3);
                            return;
                        }
                        break;
                    }
                    this.charClass = (CharacterClass) BitConverter.ToUInt32(data, 3);
                    this.objectName = ByteConverter.GetNullString(data, 0x18);
                    return;

                case InformationMessageType.PlayerRelation:
                    this.informationType = (PlayerInformationActionType) this.actionType;
                    this.objectUID = BitConverter.ToUInt32(data, 3);
                    this.relationType = (PlayerRelationActionType) data[7];
                    return;

                case InformationMessageType.SoJsSoldToMerchants:
                    this.amount = BitConverter.ToInt32(data, 3);
                    break;

                default:
                    return;
            }
        }