maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
333 lines (328 loc) • 8.92 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var characterPetEquipment = require('../../../common/dto/character/characterPetEquipment.js');
/**
* 角色已裝備寵物資訊
*/
class CharacterPetEquipmentDto extends characterPetEquipment.CharacterPetEquipmentDto {
/**
* 要搜尋的日期 (TST,每日資料中的小時與分鐘將顯示為 0)
*/
date;
/**
* 寵物 1 名稱
*/
pet1Name;
/**
* 寵物 1 暱稱
*/
pet1Nickname;
/**
* 寵物 1 圖示
*/
pet1Icon;
/**
* 寵物 1 描述
*/
pet1Description;
/**
* 寵物 1 道具資訊
*/
pet1Equipment;
/**
* 寵物 1 的寵物自動加持技能資訊
*/
pet1AutoSkill;
/**
* 寵物 1 神奇寵物類型
*/
pet1PetType;
/**
* 寵物 1 技能
*/
pet1Skill;
/**
* 寵物 1 魔法時間 (TST,時間單位資料中的分鐘顯示為 0)
*/
pet1DateExpire = null;
/**
* Whether the magic time for pet 1 is expired
*/
pet1Expired = null;
/**
* 寵物 1 外型
*/
pet1Appearance;
/**
* 寵物 1 外型圖示
*/
pet1AppearanceIcon;
/**
* 寵物 2 名稱
*/
pet2Name;
/**
* 寵物 2 暱稱
*/
pet2Nickname;
/**
* 寵物 2 圖示
*/
pet2Icon;
/**
* 寵物 2 描述
*/
pet2Description;
/**
* 寵物 2 道具資訊
*/
pet2Equipment;
/**
* 寵物 2 的寵物自動加持技能資訊
*/
pet2AutoSkill;
/**
* 寵物 2 神奇寵物類型
*/
pet2PetType;
/**
* 寵物 2 技能
*/
pet2Skill;
/**
* 寵物 2 魔法時間 (TST,時間單位資料中的分鐘顯示為 0)
*/
pet2DateExpire = null;
/**
* Whether the magic time for pet 2 is expired
*/
pet2Expired = null;
/**
* 寵物 2 外型
*/
pet2Appearance;
/**
* 寵物 2 外型圖示
*/
pet2AppearanceIcon;
/**
* 寵物 3 名稱
*/
pet3Name;
/**
* 寵物 3 暱稱
*/
pet3Nickname;
/**
* 寵物 3 圖示
*/
pet3Icon;
/**
* 寵物 3 描述
*/
pet3Description;
/**
* 寵物 3 道具資訊
*/
pet3Equipment;
/**
* 寵物 3 的寵物自動加持技能資訊
*/
pet3AutoSkill;
/**
* 寵物 3 神奇寵物類型
*/
pet3PetType;
/**
* 寵物 3 技能
*/
pet3Skill;
/**
* 寵物 3 魔法時間 (TST,時間單位資料中的分鐘顯示為 0)
*/
pet3DateExpire = null;
/**
* Whether the magic time for pet 3 is expired
*/
pet3Expired = null;
/**
* 寵物 3 外型
*/
pet3Appearance;
/**
* 寵物 3 外型圖示
*/
pet3AppearanceIcon;
constructor(obj) {
super();
const { date, pet_1_name, pet_1_nickname, pet_1_icon, pet_1_description, pet_1_equipment, pet_1_auto_skill, pet_1_pet_type, pet_1_skill, pet_1_date_expire, pet_1_appearance, pet_1_appearance_icon, pet_2_name, pet_2_nickname, pet_2_icon, pet_2_description, pet_2_equipment, pet_2_auto_skill, pet_2_pet_type, pet_2_skill, pet_2_date_expire, pet_2_appearance, pet_2_appearance_icon, pet_3_name, pet_3_nickname, pet_3_icon, pet_3_description, pet_3_equipment, pet_3_auto_skill, pet_3_pet_type, pet_3_skill, pet_3_date_expire, pet_3_appearance, pet_3_appearance_icon, } = obj;
this.date = date ? new Date(date) : null;
this.pet1Name = pet_1_name;
this.pet1Nickname = pet_1_nickname;
this.pet1Icon = pet_1_icon;
this.pet1Description = pet_1_description;
this.pet1Equipment = pet_1_equipment
? new CharacterPetEquipmentItemDto(pet_1_equipment)
: null;
this.pet1AutoSkill = pet_1_auto_skill
? new CharacterPetEquipmentAutoSkillDto(pet_1_auto_skill)
: null;
this.pet1PetType = pet_1_pet_type;
this.pet1Skill = pet_1_skill;
this.pet1Appearance = pet_1_appearance;
this.pet1AppearanceIcon = pet_1_appearance_icon;
this.pet2Name = pet_2_name;
this.pet2Nickname = pet_2_nickname;
this.pet2Icon = pet_2_icon;
this.pet2Description = pet_2_description;
this.pet2Equipment = pet_2_equipment
? new CharacterPetEquipmentItemDto(pet_2_equipment)
: null;
this.pet2AutoSkill = pet_2_auto_skill
? new CharacterPetEquipmentAutoSkillDto(pet_2_auto_skill)
: null;
this.pet2PetType = pet_2_pet_type;
this.pet2Skill = pet_2_skill;
this.pet2Appearance = pet_2_appearance;
this.pet2AppearanceIcon = pet_2_appearance_icon;
this.pet3Name = pet_3_name;
this.pet3Nickname = pet_3_nickname;
this.pet3Icon = pet_3_icon;
this.pet3Description = pet_3_description;
this.pet3Equipment = pet_3_equipment
? new CharacterPetEquipmentItemDto(pet_3_equipment)
: null;
this.pet3AutoSkill = pet_3_auto_skill
? new CharacterPetEquipmentAutoSkillDto(pet_3_auto_skill)
: null;
this.pet3PetType = pet_3_pet_type;
this.pet3Skill = pet_3_skill;
this.pet3Appearance = pet_3_appearance;
this.pet3AppearanceIcon = pet_3_appearance_icon;
if (pet_1_date_expire === 'expired') {
this.pet1Expired = true;
}
else if (typeof pet_1_date_expire === 'string') {
this.pet1DateExpire = pet_1_date_expire
? new Date(pet_1_date_expire)
: null;
}
if (pet_2_date_expire === 'expired') {
this.pet2Expired = true;
}
else if (typeof pet_2_date_expire === 'string') {
this.pet2DateExpire = pet_2_date_expire
? new Date(pet_2_date_expire)
: null;
}
if (pet_3_date_expire === 'expired') {
this.pet3Expired = true;
}
else if (typeof pet_3_date_expire === 'string') {
this.pet3DateExpire = pet_3_date_expire
? new Date(pet_3_date_expire)
: null;
}
}
}
/**
* 寵物的寵物自動加持技能資訊
*/
class CharacterPetEquipmentAutoSkillDto extends characterPetEquipment.CharacterPetEquipmentAutoSkillDto {
/**
* 登錄於第一欄位的自動加持技能
*/
skill1;
/**
* 登錄於第一欄位的自動加持技能圖示
*/
skill1Icon;
/**
* 登錄於第二欄位的自動加持技能
*/
skill2;
/**
* 登錄於第二欄位的自動加持技能圖示
*/
skill2Icon;
constructor(obj) {
super();
const { skill_1, skill_1_icon, skill_2, skill_2_icon } = obj;
this.skill1 = skill_1;
this.skill1Icon = skill_1_icon;
this.skill2 = skill_2;
this.skill2Icon = skill_2_icon;
}
}
/**
* 道具顯示選項
*/
class CharacterPetEquipmentItemOptionDto extends characterPetEquipment.CharacterPetEquipmentItemOptionDto {
/**
* 選項類型
*/
optionType;
/**
* 選項數值
*/
optionValue;
constructor(obj) {
super();
const { option_type, option_value } = obj;
this.optionType = option_type;
this.optionValue = option_value;
}
}
/**
* 寵物道具資訊
*/
class CharacterPetEquipmentItemDto extends characterPetEquipment.CharacterPetEquipmentItemDto {
/**
* 道具名稱
*/
itemName;
/**
* 道具圖示
*/
itemIcon;
/**
* 道具描述
*/
itemDescription;
/**
* 道具顯示選項
*/
itemOption;
/**
* 強化次數
*/
scrollUpgrade;
/**
* 道具可升級次數
*/
scrollUpgradable;
/**
* 道具外型
*/
itemShape;
/**
* 道具外型圖示
*/
itemShapeIcon;
constructor(obj) {
super();
const { item_name, item_icon, item_description, item_option, scroll_upgrade, scroll_upgradable, item_shape, item_shape_icon, } = obj;
this.itemName = item_name;
this.itemIcon = item_icon;
this.itemDescription = item_description;
this.itemOption = item_option.map((option) => new CharacterPetEquipmentItemOptionDto(option));
this.scrollUpgrade = scroll_upgrade;
this.scrollUpgradable = scroll_upgradable;
this.itemShape = item_shape;
this.itemShapeIcon = item_shape_icon;
}
}
exports.CharacterPetEquipmentAutoSkillDto = CharacterPetEquipmentAutoSkillDto;
exports.CharacterPetEquipmentDto = CharacterPetEquipmentDto;
exports.CharacterPetEquipmentItemDto = CharacterPetEquipmentItemDto;
exports.CharacterPetEquipmentItemOptionDto = CharacterPetEquipmentItemOptionDto;