maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
333 lines (328 loc) • 8.96 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var characterPetEquipment = require('../../../common/dto/character/characterPetEquipment.js');
/**
* Character equipped pet information
*/
class CharacterPetEquipmentDto extends characterPetEquipment.CharacterPetEquipmentDto {
/**
* Reference date for query (SGT, daily data with hours and minutes set to 0)
*/
date;
/**
* Name of pet 1
*/
pet1Name;
/**
* Nickname of pet 1
*/
pet1Nickname;
/**
* Icon of pet 1
*/
pet1Icon;
/**
* Description of pet 1
*/
pet1Description;
/**
* Equipment information for pet 1
*/
pet1Equipment;
/**
* Auto buff skill information for pet 1
*/
pet1AutoSkill;
/**
* Wonder pet type of pet 1
*/
pet1PetType;
/**
* Skills possessed by pet 1
*/
pet1Skill;
/**
* Magic time for pet 1 (SGT, data with minutes set to 0)
*/
pet1DateExpire = null;
/**
* Whether the magic time for pet 1 is expired
*/
pet1Expired = null;
/**
* Appearance of pet 1
*/
pet1Appearance;
/**
* Appearance icon of pet 1
*/
pet1AppearanceIcon;
/**
* Name of pet 2
*/
pet2Name;
/**
* Nickname of pet 2
*/
pet2Nickname;
/**
* Icon of pet 2
*/
pet2Icon;
/**
* Description of pet 2
*/
pet2Description;
/**
* Equipment information for pet 2
*/
pet2Equipment;
/**
* Auto buff skill information for pet 2
*/
pet2AutoSkill;
/**
* Wonder pet type of pet 2
*/
pet2PetType;
/**
* Skills possessed by pet 2
*/
pet2Skill;
/**
* Magic time for pet 2 (SGT, data with minutes set to 0)
*/
pet2DateExpire = null;
/**
* Whether the magic time for pet 2 is expired
*/
pet2Expired = null;
/**
* Appearance of pet 2
*/
pet2Appearance;
/**
* Appearance icon of pet 2
*/
pet2AppearanceIcon;
/**
* Name of pet 3
*/
pet3Name;
/**
* Nickname of pet 3
*/
pet3Nickname;
/**
* Icon of pet 3
*/
pet3Icon;
/**
* Description of pet 3
*/
pet3Description;
/**
* Equipment information for pet 3
*/
pet3Equipment;
/**
* Auto buff skill information for pet 3
*/
pet3AutoSkill;
/**
* Wonder pet type of pet 3
*/
pet3PetType;
/**
* Skills possessed by pet 3
*/
pet3Skill;
/**
* Magic time for pet 3 (SGT, data with minutes set to 0)
*/
pet3DateExpire = null;
/**
* Whether the magic time for pet 3 is expired
*/
pet3Expired = null;
/**
* Appearance of pet 3
*/
pet3Appearance;
/**
* Appearance icon of pet 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;
}
}
}
/**
* Auto buff skill information for pet
*/
class CharacterPetEquipmentAutoSkillDto extends characterPetEquipment.CharacterPetEquipmentAutoSkillDto {
/**
* Auto skill registered in the first slot
*/
skill1;
/**
* Icon for the auto skill in the first slot
*/
skill1Icon;
/**
* Auto skill registered in the second slot
*/
skill2;
/**
* Icon for the auto skill in the second slot
*/
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;
}
}
/**
* Displayed pet item options
*/
class CharacterPetEquipmentItemOptionDto extends characterPetEquipment.CharacterPetEquipmentItemOptionDto {
/**
* Option type
*/
optionType;
/**
* Option value
*/
optionValue;
constructor(obj) {
super();
const { option_type, option_value } = obj;
this.optionType = option_type;
this.optionValue = option_value;
}
}
/**
* Equipment information for pet
*/
class CharacterPetEquipmentItemDto extends characterPetEquipment.CharacterPetEquipmentItemDto {
/**
* Item name
*/
itemName;
/**
* Item icon
*/
itemIcon;
/**
* Item description
*/
itemDescription;
/**
* Displayed item options
*/
itemOption;
/**
* Number of upgrades
*/
scrollUpgrade;
/**
* Number of upgrades available
*/
scrollUpgradable;
/**
* Item appearance
*/
itemShape;
/**
* Item appearance icon
*/
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;