From 6af8905ef808fde9ffb2dfffdc8e695f5123a662 Mon Sep 17 00:00:00 2001 From: rainlizard <15337628+rainlizard@users.noreply.github.com> Date: Sun, 12 May 2024 22:30:06 +1000 Subject: [PATCH] cfg refactor wip 6 --- Autoload/Graphics.gd | 245 ++++++------- Autoload/ObjectNames.gd | 267 ++++++++++++++ Autoload/Things.gd | 720 ++++++++++++-------------------------- Scenes/FxData.gd | 58 ++- Scenes/OldCfgCode.gd | 4 +- Scenes/PickThingWindow.gd | 12 +- project.godot | 1 + 7 files changed, 677 insertions(+), 630 deletions(-) create mode 100644 Autoload/ObjectNames.gd diff --git a/Autoload/Graphics.gd b/Autoload/Graphics.gd index 58634b2e..e0361bc4 100644 --- a/Autoload/Graphics.gd +++ b/Autoload/Graphics.gd @@ -1,6 +1,7 @@ extends Node -# The keys can be integers or strings. As read from objects.cfg's AnimationID field. +# The keys can be integers or strings (as read from objects.cfg's AnimationID field) +# When they're a String, they can be either read the 'Name' field or the 'AnimationID' field, whichever one is prioritized var sprite_id = { 046 : preload("res://dk_images/furniture/torture_machine_tp/r1frame01.png"), 098 : preload("res://dk_images/furniture/workshop_machine_tp/AnimWorkshopMachine.tres"), @@ -29,7 +30,7 @@ var sprite_id = { 156 : preload("res://edited_images/lair/creature_skeleton/anim0158/AnimLairSkeleton.tres"), 158 : preload("res://edited_images/lair/creature_horny/anim0160/AnimLairHornedReaper.tres"), 776 : preload("res://dk_images/crucials/anim0780/AnimHeroGate.tres"), -777 : preload("res://edited_images/icon_handofevil.png"), +777 : preload("res://edited_images/icon_book.png"), 781 : preload("res://dk_images/power_hand/anim0782/AnimePowerHandGold.tres"), 782 : preload("res://dk_images/power_hand/anim0783/AnimePowerHand.tres"), 783 : preload("res://dk_images/power_hand/anim0784/AnimePowerHandGrab.tres"), @@ -58,6 +59,7 @@ var sprite_id = { 901 : preload("res://dk_images/trapdoor_64/bonus_box_std.png"), 905 : preload("res://dk_images/statues/anim0907/r1frame01.png"), 930 : preload("res://dk_images/other/anim0932/r1frame01.png"), +933 : preload("res://dk_images/valuables/gold_sack_tp/r1frame01.png"), 934 : preload("res://dk_images/valuables/gold_pot_tp/AnimGoldPot.tres"), 936 : preload("res://dk_images/valuables/gold_hoard1_tp/AnimGoldHoard1.tres"), 937 : preload("res://dk_images/valuables/gold_hoard2_tp/AnimGoldHoard2.tres"), @@ -69,21 +71,65 @@ var sprite_id = { 952 : preload("res://dk_images/statues/anim0954/r1frame01.png"), 958 : preload("res://dk_images/statues/anim0960/r1frame01.png"), 962 : preload("res://dk_images/other/anim0963/r1frame01.png"), + +# Extras +"ACTIONPOINT" : preload("res://Art/ActionPoint.png"), +"LIGHT" : preload("res://edited_images/GUIEDIT-1/PIC26.png"), +# Doors +"WOOD" : preload("res://dk_images/trapdoor_64/door_pers_wood_std.png"), +"BRACED" : preload("res://dk_images/trapdoor_64/door_pers_braced_std.png"), +"STEEL" : preload("res://dk_images/trapdoor_64/door_pers_iron_std.png"), +"MAGIC" : preload("res://dk_images/trapdoor_64/door_pers_magic_std.png"), +"SECRET" : preload("res://dk_images/trapdoor_64/door_pers_magic_std.png"), +# EffectGens +"EFFECTGENERATOR_LAVA" : preload("res://edited_images/GUIEDIT-1/PIC27.png"), +"EFFECTGENERATOR_DRIPPING_WATER" : preload("res://edited_images/GUIEDIT-1/PIC28.png"), +"EFFECTGENERATOR_ROCK_FALL" : preload("res://edited_images/GUIEDIT-1/PIC29.png"), +"EFFECTGENERATOR_ENTRANCE_ICE" : preload("res://edited_images/GUIEDIT-1/PIC30.png"), +"EFFECTGENERATOR_DRY_ICE" : preload("res://edited_images/GUIEDIT-1/PIC31.png"), +# Traps +"BOULDER" : preload("res://dk_images/trapdoor_64/trap_boulder_std.png"), +"ALARM" : preload("res://dk_images/trapdoor_64/trap_alarm_std.png"), +"POISON_GAS" : preload("res://dk_images/trapdoor_64/trap_gas_std.png"), +"LIGHTNING" : preload("res://dk_images/trapdoor_64/trap_lightning_std.png"), +"WORD_OF_POWER" : preload("res://dk_images/trapdoor_64/trap_wop_std.png"), +"LAVA" : preload("res://dk_images/trapdoor_64/trap_lava_std.png"), +"TNT" : preload("res://used_images/tnt.png"), +# Spellbooks +"SPELLBOOK_ARMG" : preload("res://dk_images/keepower_64/armagedn_std.png"), +"SPELLBOOK_POSS" : preload("res://dk_images/keepower_64/possess_std.png"), +"SPELLBOOK_HOE" : preload("res://edited_images/icon_handofevil.png"), +"SPELLBOOK_IMP" : preload("res://dk_images/keepower_64/imp_std.png"), +"SPELLBOOK_OBEY" : preload("res://edited_images/mustobey.png"), +"SPELLBOOK_SLAP" : preload("res://edited_images/icon_slap.png"), +"SPELLBOOK_SOE" : preload("res://dk_images/keepower_64/sight_std.png"), +"SPELLBOOK_CTA" : preload("res://dk_images/keepower_64/cta_std.png"), +"SPELLBOOK_CAVI" : preload("res://dk_images/keepower_64/cavein_std.png"), +"SPELLBOOK_HEAL" : preload("res://dk_images/keepower_64/heal_std.png"), +"SPELLBOOK_HLDAUD" : preload("res://dk_images/keepower_64/holdaud_std.png"), +"SPELLBOOK_LIGHTN" : preload("res://dk_images/keepower_64/lightng_std.png"), +"SPELLBOOK_SPDC" : preload("res://dk_images/keepower_64/speed_std.png"), +"SPELLBOOK_PROT" : preload("res://dk_images/keepower_64/armor_std.png"), +"SPELLBOOK_CONCL" : preload("res://dk_images/keepower_64/conceal_std.png"), +"SPELLBOOK_DISEASE" : preload("res://dk_images/keepower_64/disease_std.png"), +"SPELLBOOK_CHKN" : preload("res://dk_images/keepower_64/chicken_std.png"), +"SPELLBOOK_DWAL" : preload("res://dk_images/keepower_64/dstwall_std.png"), +"SPELLBOOK_TBMB" : preload("res://edited_images/timebomb.png"), +# Decorations/Furniture "BANNER" : preload("res://used_images/banner.png"), -"DRUID_LAIR" : preload("res://used_images/lair_druid.png"), "FERN" : preload("res://used_images/fern.png"), "FERN_BROWN" : preload("res://used_images/fern_brown.png"), "FERN_SMALL" : preload("res://used_images/fern_small.png"), "FERN_SMALL_BROWN" : preload("res://used_images/fern_small_brown.png"), -"FLAGPOLE_BLACKFLAG" : "", -"FLAGPOLE_ORANGEFLAG" : "", -"FLAGPOLE_PURPLEFLAG" : "", -"FLAGPOLE_WHITEFLAG" : "", +"FLAGPOLE_BLACKFLAG" : preload("res://dk_images/furniture/flagpole_blackflag_tp/AnimFlagpoleBlack.tres"), +"FLAGPOLE_ORANGEFLAG" : preload("res://dk_images/furniture/flagpole_orangeflag_tp/AnimFlagpoleOrange.tres"), +"FLAGPOLE_PURPLEFLAG" : preload("res://dk_images/furniture/flagpole_purpleflag_tp/AnimFlagpolePurple.tres"), +"FLAGPOLE_WHITEFLAG" : preload("res://dk_images/furniture/flagpole_whiteflag_tp/AnimFlagpoleWhite.tres"), "GOLDEN_ARMOR" : preload("res://dk_images/statues/anim0956/r1frame01.png"), -"HEARTFLAME_BLACK" : "", -"HEARTFLAME_ORANGE" : "", -"HEARTFLAME_PURPLE" : "", -"HEARTFLAME_WHITE" : "", +"HEARTFLAME_BLACK" : preload("res://edited_images/heartflames/heartflame_black/AnimBlackHeartFlame.tres"), +"HEARTFLAME_ORANGE" : preload("res://edited_images/heartflames/heartflame_orange/AnimOrangeHeartFlame.tres"), +"HEARTFLAME_PURPLE" : preload("res://edited_images/heartflames/heartflame_purple/AnimPurpleHeartFlame.tres"), +"HEARTFLAME_WHITE" : preload("res://edited_images/heartflames/heartflame_white/AnimWhiteHeartFlame.tres"), "ICE_PILLAR" : preload("res://used_images/ice_pillar.png"), "ICE_PILLAR_SMALL" : preload("res://used_images/ice_rock.png"), "JUNGLE_CATTAILS" : preload("res://used_images/cattails.png"), @@ -99,114 +145,75 @@ var sprite_id = { "POTION_RED" : preload("res://used_images/potion_red.png"), "POTION_WHITE" : preload("res://used_images/potion_white.png"), "POTION_YELLOW" : preload("res://used_images/potion_yellow.png"), - "ROCK_PILLAR" : preload("res://used_images/rock_pillar.png"), "ROCK_PILLAR_SMALL" : preload("res://used_images/rock.png"), -"IMG_ARMAGEDDON" : preload("res://dk_images/keepower_64/armagedn_std.png"), -"IMG_POSSESS_CREATURE" : preload("res://dk_images/keepower_64/possess_std.png"), -"IMG_HAND_OF_EVIL" : preload("res://edited_images/icon_handofevil.png"), -"IMG_CREATE_IMP" : preload("res://dk_images/keepower_64/imp_std.png"), -"IMG_MUST_OBEY" : preload("res://edited_images/mustobey.png"), -"IMG_SLAP" : preload("res://edited_images/icon_slap.png"), -"IMG_SIGHT_OF_EVIL" : preload("res://dk_images/keepower_64/sight_std.png"), -"IMG_CALL_TO_ARMS" : preload("res://dk_images/keepower_64/cta_std.png"), -"IMG_CAVE_IN" : preload("res://dk_images/keepower_64/cavein_std.png"), -"IMG_HEAL_CREATURE" : preload("res://dk_images/keepower_64/heal_std.png"), -"IMG_HOLD_AUDIENCE" : preload("res://dk_images/keepower_64/holdaud_std.png"), -"IMG_LIGHTNING" : preload("res://dk_images/keepower_64/lightng_std.png"), -"IMG_SPEED_CREATURE" : preload("res://dk_images/keepower_64/speed_std.png"), -"IMG_PROTECT_CREATURE" : preload("res://dk_images/keepower_64/armor_std.png"), -"IMG_CONCEAL_CREATURE" : preload("res://dk_images/keepower_64/conceal_std.png"), -"IMG_DISEASE" : preload("res://dk_images/keepower_64/disease_std.png"), -"IMG_CHICKEN" : preload("res://dk_images/keepower_64/chicken_std.png"), -"IMG_DESTROY_WALLS" : preload("res://dk_images/keepower_64/dstwall_std.png"), -"IMG_TIME_BOMB" : preload("res://edited_images/timebomb.png"), -"IMG_POWER_SIGHT" : preload("res://dk_images/magic_fogs/anim0854/AnimCastedSight.tres"), - -"IMG_WIZARD" : preload("res://edited_images/creatr_icon_64/wizrd_std.png"), -"IMG_WIZARD_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_wizrd.png"), -"IMG_BARBARIAN" : preload("res://edited_images/creatr_icon_64/barbr_std.png"), -"IMG_BARBARIAN_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_barbr.png"), -"IMG_ARCHER" : preload("res://edited_images/creatr_icon_64/archr_std.png"), -"IMG_ARCHER_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_archr.png"), -"IMG_MONK" : preload("res://edited_images/creatr_icon_64/monk_std.png"), -"IMG_MONK_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_monk.png"), -"IMG_DWARFA" : preload("res://edited_images/creatr_icon_64/dwarf_std.png"), -"IMG_DWARFA_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_dwrf1.png"), -"IMG_KNIGHT" : preload("res://edited_images/creatr_icon_64/knght_std.png"), -"IMG_KNIGHT_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_knigh.png"), -"IMG_AVATAR" : preload("res://edited_images/creatr_icon_64/avatr_std.png"), -"IMG_AVATAR_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_avatr.png"), -"IMG_TUNNELLER" : preload("res://edited_images/creatr_icon_64/tunlr_std.png"), -"IMG_TUNNELLER_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_dwrf2.png"), -"IMG_WITCH" : preload("res://edited_images/creatr_icon_64/prsts_std.png"), -"IMG_WITCH_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_witch.png"), -"IMG_GIANT" : preload("res://edited_images/creatr_icon_64/giant_std.png"), -"IMG_GIANT_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_giant.png"), -"IMG_FAIRY" : preload("res://edited_images/creatr_icon_64/fairy_std.png"), -"IMG_FAIRY_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_fairy.png"), -"IMG_THIEF" : preload("res://edited_images/creatr_icon_64/thief_std.png"), -"IMG_THIEF_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_thief.png"), -"IMG_SAMURAI" : preload("res://edited_images/creatr_icon_64/samur_std.png"), -"IMG_SAMURAI_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_samur.png"), -"IMG_HORNY" : preload("res://edited_images/creatr_icon_64/hornd_std.png"), -"IMG_HORNY_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_horny.png"), -"IMG_SKELETON" : preload("res://edited_images/creatr_icon_64/skelt_std.png"), -"IMG_SKELETON_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_skelt.png"), -"IMG_TROLL" : preload("res://edited_images/creatr_icon_64/troll_std.png"), -"IMG_TROLL_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_troll.png"), -"IMG_DRAGON" : preload("res://edited_images/creatr_icon_64/dragn_std.png"), -"IMG_DRAGON_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_dragn.png"), -"IMG_DEMONSPAWN" : preload("res://edited_images/creatr_icon_64/dspwn_std.png"), -"IMG_DEMONSPAWN_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_spawn.png"), -"IMG_FLY" : preload("res://edited_images/creatr_icon_64/fly_std.png"), -"IMG_FLY_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_fly.png"), -"IMG_DARK_MISTRESS" : preload("res://edited_images/creatr_icon_64/dkmis_std.png"), -"IMG_DARK_MISTRESS_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_mistr.png"), -"IMG_SORCEROR" : preload("res://edited_images/creatr_icon_64/warlk_std.png"), -"IMG_SORCEROR_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_warlk.png"), -"IMG_BILE_DEMON" : preload("res://edited_images/creatr_icon_64/biled_std.png"), -"IMG_BILE_DEMON_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_biled.png"), -"IMG_IMP" : preload("res://edited_images/creatr_icon_64/imp_std.png"), -"IMG_IMP_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_imp.png"), -"IMG_BUG" : preload("res://edited_images/creatr_icon_64/bug_std.png"), -"IMG_BUG_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_bug.png"), -"IMG_VAMPIRE" : preload("res://edited_images/creatr_icon_64/vampr_std.png"), -"IMG_VAMPIRE_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_vampr.png"), -"IMG_SPIDER" : preload("res://edited_images/creatr_icon_64/spidr_std.png"), -"IMG_SPIDER_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_spidr.png"), -"IMG_HELL_HOUND" : preload("res://edited_images/creatr_icon_64/hound_std.png"), -"IMG_HELL_HOUND_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_hound.png"), -"IMG_GHOST" : preload("res://edited_images/creatr_icon_64/ghost_std.png"), -"IMG_GHOST_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_ghost.png"), -"IMG_TENTACLE" : preload("res://edited_images/creatr_icon_64/tentc_std.png"), -"IMG_TENTACLE_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_tentc.png"), -"IMG_ORC" : preload("res://edited_images/creatr_icon_64/orc_std.png"), -"IMG_ORC_PORTRAIT" :preload("res://dk_images/creature_portrait_64/creatr_portrt_orc.png"), -"IMG_FLOATING_SPIRIT" : preload("res://dk_images/magic_dust/anim0981/r1frame02.png"), -"IMG_FLOATING_SPIRIT_PORTRAIT" :preload("res://dk_images/magic_dust/anim0981/r1frame02.png"), - -"IMG_EFFECTGENERATOR_LAVA" : preload("res://edited_images/GUIEDIT-1/PIC27.png"), -"IMG_EFFECTGENERATOR_DRIPPING_WATER" : preload("res://edited_images/GUIEDIT-1/PIC28.png"), -"IMG_EFFECTGENERATOR_ROCK_FALL" : preload("res://edited_images/GUIEDIT-1/PIC29.png"), -"IMG_EFFECTGENERATOR_ENTRANCE_ICE" : preload("res://edited_images/GUIEDIT-1/PIC30.png"), -"IMG_EFFECTGENERATOR_DRY_ICE" : preload("res://edited_images/GUIEDIT-1/PIC31.png"), - -"IMG_BOULDER" : preload("res://dk_images/trapdoor_64/trap_boulder_std.png"), -"IMG_ALARM" : preload("res://dk_images/trapdoor_64/trap_alarm_std.png"), -"IMG_POISON_GAS" : preload("res://dk_images/trapdoor_64/trap_gas_std.png"), -"IMG_LIGHTNING_TRAP" : preload("res://dk_images/trapdoor_64/trap_lightning_std.png"), -"IMG_WORD_OF_POWER" : preload("res://dk_images/trapdoor_64/trap_wop_std.png"), -"IMG_LAVA" : preload("res://dk_images/trapdoor_64/trap_lava_std.png"), -"IMG_TNT" : preload("res://used_images/tnt.png"), - -"IMG_WOOD" : preload("res://dk_images/trapdoor_64/door_pers_wood_std.png"), -"IMG_BRACED" : preload("res://dk_images/trapdoor_64/door_pers_braced_std.png"), -"IMG_STEEL" : preload("res://dk_images/trapdoor_64/door_pers_iron_std.png"), -"IMG_MAGIC" : preload("res://dk_images/trapdoor_64/door_pers_magic_std.png"), - -"IMG_ACTIONPOINT" : preload("res://Art/ActionPoint.png"), -"IMG_LIGHT" : preload("res://edited_images/GUIEDIT-1/PIC26.png"), -"IMG_BOOK_ICON" : preload("res://edited_images/icon_book.png"), - +"DRUID_LAIR" : preload("res://used_images/lair_druid.png"), +# Creatures +"POWER_SIGHT" : preload("res://dk_images/magic_fogs/anim0854/AnimCastedSight.tres"), +"WIZARD" : preload("res://edited_images/creatr_icon_64/wizrd_std.png"), +"WIZARD_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_wizrd.png"), +"BARBARIAN" : preload("res://edited_images/creatr_icon_64/barbr_std.png"), +"BARBARIAN_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_barbr.png"), +"ARCHER" : preload("res://edited_images/creatr_icon_64/archr_std.png"), +"ARCHER_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_archr.png"), +"MONK" : preload("res://edited_images/creatr_icon_64/monk_std.png"), +"MONK_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_monk.png"), +"DWARFA" : preload("res://edited_images/creatr_icon_64/dwarf_std.png"), +"DWARFA_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_dwrf1.png"), +"KNIGHT" : preload("res://edited_images/creatr_icon_64/knght_std.png"), +"KNIGHT_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_knigh.png"), +"AVATAR" : preload("res://edited_images/creatr_icon_64/avatr_std.png"), +"AVATAR_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_avatr.png"), +"TUNNELLER" : preload("res://edited_images/creatr_icon_64/tunlr_std.png"), +"TUNNELLER_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_dwrf2.png"), +"WITCH" : preload("res://edited_images/creatr_icon_64/prsts_std.png"), +"WITCH_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_witch.png"), +"GIANT" : preload("res://edited_images/creatr_icon_64/giant_std.png"), +"GIANT_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_giant.png"), +"FAIRY" : preload("res://edited_images/creatr_icon_64/fairy_std.png"), +"FAIRY_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_fairy.png"), +"THIEF" : preload("res://edited_images/creatr_icon_64/thief_std.png"), +"THIEF_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_thief.png"), +"SAMURAI" : preload("res://edited_images/creatr_icon_64/samur_std.png"), +"SAMURAI_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_samur.png"), +"HORNY" : preload("res://edited_images/creatr_icon_64/hornd_std.png"), +"HORNY_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_horny.png"), +"SKELETON" : preload("res://edited_images/creatr_icon_64/skelt_std.png"), +"SKELETON_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_skelt.png"), +"TROLL" : preload("res://edited_images/creatr_icon_64/troll_std.png"), +"TROLL_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_troll.png"), +"DRAGON" : preload("res://edited_images/creatr_icon_64/dragn_std.png"), +"DRAGON_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_dragn.png"), +"DEMONSPAWN" : preload("res://edited_images/creatr_icon_64/dspwn_std.png"), +"DEMONSPAWN_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_spawn.png"), +"FLY" : preload("res://edited_images/creatr_icon_64/fly_std.png"), +"FLY_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_fly.png"), +"DARK_MISTRESS" : preload("res://edited_images/creatr_icon_64/dkmis_std.png"), +"DARK_MISTRESS_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_mistr.png"), +"SORCEROR" : preload("res://edited_images/creatr_icon_64/warlk_std.png"), +"SORCEROR_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_warlk.png"), +"BILE_DEMON" : preload("res://edited_images/creatr_icon_64/biled_std.png"), +"BILE_DEMON_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_biled.png"), +"IMP" : preload("res://edited_images/creatr_icon_64/imp_std.png"), +"IMP_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_imp.png"), +"BUG" : preload("res://edited_images/creatr_icon_64/bug_std.png"), +"BUG_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_bug.png"), +"VAMPIRE" : preload("res://edited_images/creatr_icon_64/vampr_std.png"), +"VAMPIRE_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_vampr.png"), +"SPIDER" : preload("res://edited_images/creatr_icon_64/spidr_std.png"), +"SPIDER_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_spidr.png"), +"HELL_HOUND" : preload("res://edited_images/creatr_icon_64/hound_std.png"), +"HELL_HOUND_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_hound.png"), +"GHOST" : preload("res://edited_images/creatr_icon_64/ghost_std.png"), +"GHOST_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_ghost.png"), +"TENTACLE" : preload("res://edited_images/creatr_icon_64/tentc_std.png"), +"TENTACLE_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_tentc.png"), +"ORC" : preload("res://edited_images/creatr_icon_64/orc_std.png"), +"ORC_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_orc.png"), +"FLOATING_SPIRIT" : preload("res://dk_images/magic_dust/anim0981/r1frame02.png"), +"FLOATING_SPIRIT_PORTRAIT" : preload("res://dk_images/magic_dust/anim0981/r1frame02.png"), +"DRUID" : preload("res://used_images/druid.png"), +"DRUID_PORTRAIT" : preload("res://used_images/druid_portrait.png"), +"TIME_MAGE" : preload("res://used_images/time_mage.png"), +"TIME_MAGE_PORTRAIT" : preload("res://used_images/time_mage_portrait.png"), } diff --git a/Autoload/ObjectNames.gd b/Autoload/ObjectNames.gd new file mode 100644 index 00000000..9a4f128e --- /dev/null +++ b/Autoload/ObjectNames.gd @@ -0,0 +1,267 @@ +extends Node + +enum TYPE { + NONE = 0 + OBJECT = 1 + SHOT = 2 + EFFECTELEM = 3 + DEADCREATURE = 4 + CREATURE = 5 + EFFECT = 6 + EFFECTGEN = 7 + TRAP = 8 + DOOR = 9 + UNKN10 = 10 + UNKN11 = 11 + AMBIENTSND = 12 + CAVEIN = 13 + EXTRA = 696969 +} + +const NAME_MAPPINGS = { + TYPE.EXTRA : { + "ACTIONPOINT" : "Action Point", + "LIGHT" : "Light", + }, + TYPE.DOOR : { + "WOOD" : "Wooden Door", + "BRACED" : "Braced Door", + "STEEL" : "Iron Door", + "MAGIC" : "Magic Door", + }, + TYPE.TRAP : { + "BOULDER" : "Boulder Trap", + "ALARM" : "Alarm Trap", + "POISON_GAS" : "Poison Gas Trap", + "LIGHTNING" : "Lightning Trap", + "WORD_OF_POWER" : "Word of Power Trap", + "LAVA" : "Lava Trap", + "TNT" : "Demolition Trap", + "DUMMYTRAP3" : "Dummy Trap 3", + "DUMMYTRAP4" : "Dummy Trap 4", + "DUMMYTRAP5" : "Dummy Trap 5", + "DUMMYTRAP6" : "Dummy Trap 6", + "DUMMYTRAP7" : "Dummy Trap 7", + }, + TYPE.EFFECTGEN : { + "EFFECTGENERATOR_LAVA" : "Lava Effect", + "EFFECTGENERATOR_DRIPPING_WATER" : "Dripping Water Effect", + "EFFECTGENERATOR_ROCK_FALL" : "Rock Fall Effect", + "EFFECTGENERATOR_ENTRANCE_ICE" : "Entrance Ice Effect", + "EFFECTGENERATOR_DRY_ICE" : "Dry Ice Effect", + }, + TYPE.CREATURE : { + "WIZARD" : "Wizard", + "BARBARIAN" : "Barbarian", + "ARCHER" : "Archer", + "MONK" : "Monk", + "DWARFA" : "Dwarf", + "KNIGHT" : "Knight", + "AVATAR" : "Avatar", + "TUNNELLER" : "Tunneller", + "WITCH" : "Witch", + "GIANT" : "Giant", + "FAIRY" : "Fairy", + "THIEF" : "Thief", + "SAMURAI" : "Samurai", + "HORNY" : "Horned Reaper", + "SKELETON" : "Skeleton", + "TROLL" : "Troll", + "DRAGON" : "Dragon", + "DEMONSPAWN" : "Demon Spawn", + "FLY" : "Fly", + "DARK_MISTRESS" : "Dark Mistress", + "SORCEROR" : "Warlock", + "BILE_DEMON" : "Bile Demon", + "IMP" : "Imp", + "BUG" : "Beetle", + "VAMPIRE" : "Vampire", + "SPIDER" : "Spider", + "HELL_HOUND" : "Hell Hound", + "GHOST" : "Ghost", + "TENTACLE" : "Tentacle", + "ORC" : "Orc", + "FLOATING_SPIRIT" : "Floating Spirit", + "TIME_MAGE" : "Time Mage", + "DRUID" : "Druid", + }, + TYPE.OBJECT : { + "BARREL" : "Barrel", + "TORCH" : "Torch", + "GOLD_CHEST" : "Gold Pot (500)", + "TEMPLE_STATUE" : "Lit Statue", + "SOUL_CONTAINER" : "Dungeon Heart", + "GOLD" : "Gold Pot (250)", + "TORCHUN" : "Unlit Torch", + "STATUEWO" : "Glowing Statue", + "CHICKEN_GRW" : "Egg Growing (1)", + "CHICKEN_MAT" : "Chicken", + "SPELLBOOK_HOE" : "Hand Of Evil", + "SPELLBOOK_IMP" : "Create Imp", + "SPELLBOOK_OBEY" : "Must Obey", + "SPELLBOOK_SLAP" : "Slap", + "SPELLBOOK_SOE" : "Sight of Evil", + "SPELLBOOK_CTA" : "Call To Arms", + "SPELLBOOK_CAVI" : "Cave-In", + "SPELLBOOK_HEAL" : "Heal", + "SPELLBOOK_HLDAUD" : "Hold Audience", + "SPELLBOOK_LIGHTN" : "Lightning Strike", + "SPELLBOOK_SPDC" : "Speed Monster", + "SPELLBOOK_PROT" : "Protect Monster", + "SPELLBOOK_CONCL" : "Conceal Monster", + "CTA_ENSIGN" : "Cta Ensign", + "ROOM_FLAG" : "Room Flag", + "ANVIL" : "Anvil", + "PRISON_BAR" : "Prison Bar", + "CANDLESTCK" : "Candlestick", + "GRAVE_STONE" : "Gravestone", + "STATUE_HORNY" : "Aztec Statue", + "TRAINING_POST" : "Training Post", + "TORTURE_SPIKE" : "Torture Spike", + "TEMPLE_SPANGLE" : "Temple Spangle", + "POTION_PURPLE" : "Purple Potion", + "POTION_BLUE" : "Blue Potion", + "POTION_GREEN" : "Green Potion", + "POWER_HAND" : "Power Hand", + "POWER_HAND_GRAB" : "Power Hand Grab", + "POWER_HAND_WHIP" : "Power Hand Whip", + "CHICKEN_STB" : "Egg Stable (2)", + "CHICKEN_WOB" : "Egg Wobbling (3)", + "CHICKEN_CRK" : "Egg Cracking (4)", + "GOLDL" : "Gold Pile (200)", + "SPINNING_KEY" : "Spinning Key", + "SPELLBOOK_DISEASE" : "Disease", + "SPELLBOOK_CHKN" : "Chicken Spell", + "SPELLBOOK_DWAL" : "Destroy Walls", + "SPELLBOOK_TBMB" : "Time Bomb", + "HERO_GATE" : "Hero Gate", + "SPINNING_KEY2" : "Spinning Key 2", + "ARMOUR" : "Armour Effect", + "GOLD_HOARD_1" : "Treasury Hoard 1 (400)", + "GOLD_HOARD_2" : "Treasury Hoard 2 (800)", + "GOLD_HOARD_3" : "Treasury Hoard 3 (1200)", + "GOLD_HOARD_4" : "Treasury Hoard 4 (1600)", + "GOLD_HOARD_5" : "Treasury Hoard 5 (2000)", + "LAIR_WIZRD" : "Wizard Lair", + "LAIR_BARBR" : "Barbarian Lair", + "LAIR_ARCHR" : "Archer Lair", + "LAIR_MONK" : "Monk Lair", + "LAIR_DWRFA" : "Dwarf Lair", + "LAIR_KNGHT" : "Knight Lair", + "LAIR_AVATR" : "Avatar Lair", + "LAIR_TUNLR" : "Tunneller Lair", + "LAIR_WITCH" : "Witch Lair", + "LAIR_GIANT" : "Giant Lair", + "LAIR_FAIRY" : "Fairy Lair", + "LAIR_THIEF" : "Thief Lair", + "LAIR_SAMUR" : "Samurai Lair", + "LAIR_HORNY" : "Horned Reaper Lair", + "LAIR_SKELT" : "Skeleton Lair", + "LAIR_GOBLN" : "Troll Lair", + "LAIR_DRAGN" : "Dragon Lair", + "LAIR_DEMSP" : "Demon Spawn Lair", + "LAIR_FLY" : "Fly Lair", + "LAIR_DKMIS" : "Mistress Lair", + "LAIR_SORCR" : "Warlock Lair", + "LAIR_BILDM" : "Bile Demon Lair", + "LAIR_IMP" : "Imp Lair", + "LAIR_BUG" : "Beetle Lair", + "LAIR_VAMP" : "Vampire Lair", + "LAIR_SPIDR" : "Spider Lair", + "LAIR_HLHND" : "Hell Hound Lair", + "LAIR_GHOST" : "Ghost Lair", + "LAIR_TENTC" : "Tentacle Lair", + "SPECBOX_REVMAP" : "Reveal Map", + "SPECBOX_RESURCT" : "Resurrect Creature", + "SPECBOX_TRANSFR" : "Transfer Creature", + "SPECBOX_STEALHR" : "Steal Hero", + "SPECBOX_MULTPLY" : "Multiply Creatures", + "SPECBOX_INCLEV" : "Increase Level", + "SPECBOX_MKSAFE" : "Make Safe", + "SPECBOX_HIDNWRL" : "Locate Hidden World", + "WRKBOX_BOULDER" : "Box: Boulder Trap", + "WRKBOX_ALARM" : "Box: Alarm Trap", + "WRKBOX_POISONG" : "Box: Poison Gas Trap", + "WRKBOX_LIGHTNG" : "Box: Lightning Trap", + "WRKBOX_WRDOFPW" : "Box: Word of Power Trap", + "WRKBOX_LAVA" : "Box: Lava Trap", + "WRKBOX_DEMOLTN" : "Box: Dummy Trap 2", + "WRKBOX_DUMMY3" : "Box: Dummy Trap 3", + "WRKBOX_DUMMY4" : "Box: Dummy Trap 4", + "WRKBOX_DUMMY5" : "Box: Dummy Trap 5", + "WRKBOX_DUMMY6" : "Box: Dummy Trap 6", + "WRKBOX_DUMMY7" : "Box: Dummy Trap 7", + "WRKBOX_WOOD" : "Box: Wooden Door", + "WRKBOX_BRACE" : "Box: Braced Door", + "WRKBOX_STEEL" : "Box: Iron Door", + "WRKBOX_MAGIC" : "Box: Magic Door", + "WRKBOX_ITEM" : "Workshop Item", + "HEARTFLAME_RED" : "Red Heart Flame", + "DISEASE" : "Disease Effect", + "SCAVENGE_EYE" : "Scavenger Eye", + "WORKSHOP_MACHINE" : "Workshop Machine", + "GUARDFLAG_RED" : "Red Flag", + "GUARDFLAG_BLUE" : "Blue Flag", + "GUARDFLAG_GREEN" : "Green Flag", + "GUARDFLAG_YELLOW" : "Yellow Flag", + "FLAG_POST" : "Flagpole", + "HEARTFLAME_BLUE" : "Blue Heart Flame", + "HEARTFLAME_GREEN" : "Green Heart Flame", + "HEARTFLAME_YELLOW" : "Yellow Heart Flame", + "POWER_SIGHT" : "Casted Sight", + "POWER_LIGHTNG" : "Casted Lightning", + "TORTURER" : "Torturer", + "LAIR_ORC" : "Orc Lair", + "POWER_HAND_GOLD" : "Power Hand Gold", + "SPINNCOIN" : "Spinning Coin", + "STATUE2" : "Unlit Statue", + "STATUE3" : "Statue 3", + "STATUE4" : "Statue 4", + "STATUE5" : "Statue 5", + "SPECBOX_CUSTOM" : "Mysterious Box", + "SPELLBOOK_ARMG" : "Armageddon Spell", + "SPELLBOOK_POSS" : "Possess Spell", + "GOLD_BAG" : "Gold Bag", + "FERN" : "Fern", + "FERN_BROWN" : "Brown Fern", + "FERN_SMALL" : "Small Fern", + "FERN_SMALL_BROWN" : "Small Brown Fern", + "MUSHROOM_YELLOW" : "Yellow Mushroom", + "MUSHROOM_GREEN" : "Green Mushroom", + "MUSHROOM_RED" : "Red Mushroom", + "LAIR_TMAGE" : "Time Mage Lair", + "LAIR_DRUID" : "Druid Lair", + "LILYPAD" : "Lilypad", + "CATTAILS" : "Cattails", + "BANNER" : "Banner", + "LANTERN_PST" : "Lantern Post", + "POTION_RED" : "Red Potion", + "POTION_BROWN" : "Brown Potion", + "POTION_WHITE" : "White Potion", + "POTION_YELLOW" : "Yellow Potion", + "ROCK_PILLAR" : "Rock Pillar", + "ROCK" : "Rock", + "LAVA_PILLAR" : "Lava Pillar", + "LAVA_ROCK" : "Lava Rock", + "ICE_PILLAR" : "Ice Pillar", + "ICE_ROCK" : "Ice Rock", + "WRKBOX_SECRET" : "Box: Secret Door", + "GUARDFLAG_WHITE" : "White Flag", + "HEARTFLAME_WHITE" : "White Heart Flame", + "SPELLBOOK_RBND" : "Rebound", + "GUARDFLAG_PURPLE" : "Purple Flag", + "HEARTFLAME_PURPLE" : "Purple Heart Flame", + "GUARDFLAG_BLACK" : "Black Flag", + "HEARTFLAME_BLACK" : "Black Heart Flame", + "GUARDFLAG_ORANGE" : "Orange Flag", + "HEARTFLAME_ORANGE" : "Orange Heart Flame", + "SPECBOX_HEALALL" : "Heal All", + "SPECBOX_GETGOLD" : "Increase Gold", + "SPECBOX_MKANGRY" : "Make Unhappy", + "SPECBOX_MKUNSAFE" : "Weaken Walls", + "SPELLBOOK_FRZ" : "Freeze", + "SPELLBOOK_SLOW" : "Slow", + "SPELLBOOK_FLGT" : "Flight", + "SPELLBOOK_VSN" : "Vision" + } +} diff --git a/Autoload/Things.gd b/Autoload/Things.gd index 4ea033f3..f230cd45 100644 --- a/Autoload/Things.gd +++ b/Autoload/Things.gd @@ -1,10 +1,14 @@ extends Node2D +const THING_LIMIT = -1 #2048 +const ACTION_POINT_LIMIT = -1 #255 +const CREATURE_LIMIT = -1 #255 +const LIGHT_LIMIT = -1 + enum { NAME_ID = 0 SPRITE = 1 - PORTRAIT = 2 # Keep PORTAIT field "null" if I want to use texture for portrait. - EDITOR_TAB = 3 + EDITOR_TAB = 2 } enum TYPE { @@ -25,11 +29,6 @@ enum TYPE { EXTRA = 696969 } -const THING_LIMIT = -1#2048 -const ACTION_POINT_LIMIT = -1#255 -const CREATURE_LIMIT = -1#255 -const LIGHT_LIMIT = -1 - func fetch_sprite(thing_type, sub_type): var sub_type_data = data_structure(thing_type).get(sub_type) @@ -39,7 +38,7 @@ func fetch_sprite(thing_type, sub_type): return sprite match sub_type_data[EDITOR_TAB]: TAB_SPECIAL: return Graphics.sprite_id.get(901, null) - TAB_SPELL: return Graphics.sprite_id.get("IMG_BOOK_ICON", null) + TAB_SPELL: return Graphics.sprite_id.get(777, null) TAB_BOX: return Graphics.sprite_id.get(114, null) return null @@ -47,13 +46,14 @@ func fetch_sprite(thing_type, sub_type): func fetch_portrait(thing_type, sub_type): var sub_type_data = data_structure(thing_type).get(sub_type) if sub_type_data: - var sprID = sub_type_data[PORTRAIT] - return Graphics.sprite_id.get(sprID, null) + var sprID = sub_type_data[SPRITE] + var asdf = str(sprID) + "_PORTRAIT" + return Graphics.sprite_id.get(asdf, null) return null func fetch_name(thing_type, sub_type): - var dictionary_of_names = NAME_MAPPINGS.get(thing_type) + var dictionary_of_names = ObjectNames.NAME_MAPPINGS.get(thing_type) if dictionary_of_names: var data_structure = data_structure(thing_type) var sub_type_data = data_structure.get(sub_type) @@ -66,256 +66,6 @@ func fetch_name(thing_type, sub_type): return "Unknown Thingtype " + str(thing_type) + ", Subtype: " + str(sub_type) - - -const NAME_MAPPINGS = { - TYPE.EXTRA : { - "ACTIONPOINT" : "Action Point", - "LIGHT" : "Light", - }, - TYPE.DOOR : { - "WOOD" : "Wooden Door", - "BRACED" : "Braced Door", - "STEEL" : "Iron Door", - "MAGIC" : "Magic Door", - }, - TYPE.TRAP : { - "BOULDER" : "Boulder Trap", - "ALARM" : "Alarm Trap", - "POISON_GAS" : "Poison Gas Trap", - "LIGHTNING" : "Lightning Trap", - "WORD_OF_POWER" : "Word of Power Trap", - "LAVA" : "Lava Trap", - "TNT" : "Dummy Trap 2", - "DUMMYTRAP3" : "Dummy Trap 3", - "DUMMYTRAP4" : "Dummy Trap 4", - "DUMMYTRAP5" : "Dummy Trap 5", - "DUMMYTRAP6" : "Dummy Trap 6", - "DUMMYTRAP7" : "Dummy Trap 7", - }, - TYPE.EFFECTGEN : { - "EFFECTGENERATOR_LAVA" : "Lava Effect", - "EFFECTGENERATOR_DRIPPING_WATER" : "Dripping Water Effect", - "EFFECTGENERATOR_ROCK_FALL" : "Rock Fall Effect", - "EFFECTGENERATOR_ENTRANCE_ICE" : "Entrance Ice Effect", - "EFFECTGENERATOR_DRY_ICE" : "Dry Ice Effect", - }, - TYPE.CREATURE : { - "WIZARD" : "Wizard", - "BARBARIAN" : "Barbarian", - "ARCHER" : "Archer", - "MONK" : "Monk", - "DWARFA" : "Dwarf", - "KNIGHT" : "Knight", - "AVATAR" : "Avatar", - "TUNNELLER" : "Tunneller", - "WITCH" : "Witch", - "GIANT" : "Giant", - "FAIRY" : "Fairy", - "THIEF" : "Thief", - "SAMURAI" : "Samurai", - "HORNY" : "Horned Reaper", - "SKELETON" : "Skeleton", - "TROLL" : "Troll", - "DRAGON" : "Dragon", - "DEMONSPAWN" : "Demon Spawn", - "FLY" : "Fly", - "DARK_MISTRESS" : "Dark Mistress", - "SORCEROR" : "Warlock", - "BILE_DEMON" : "Bile Demon", - "IMP" : "Imp", - "BUG" : "Beetle", - "VAMPIRE" : "Vampire", - "SPIDER" : "Spider", - "HELL_HOUND" : "Hell Hound", - "GHOST" : "Ghost", - "TENTACLE" : "Tentacle", - "ORC" : "Orc", - "FLOATING_SPIRIT" : "Floating Spirit", - "TIME_MAGE" : "Time Mage", - "DRUID" : "Druid", - }, - TYPE.OBJECT : { - "BARREL" : "Barrel", - "TORCH" : "Torch", - "GOLD_CHEST" : "Gold Pot (500)", - "TEMPLE_STATUE" : "Lit Statue", - "SOUL_CONTAINER" : "Dungeon Heart", - "GOLD" : "Gold Pot (250)", - "TORCHUN" : "Unlit Torch", - "STATUEWO" : "Glowing Statue", - "CHICKEN_GRW" : "Egg Growing (1)", - "CHICKEN_MAT" : "Chicken", - "SPELLBOOK_HOE" : "Hand Of Evil", - "SPELLBOOK_IMP" : "Create Imp", - "SPELLBOOK_OBEY" : "Must Obey", - "SPELLBOOK_SLAP" : "Slap", - "SPELLBOOK_SOE" : "Sight of Evil", - "SPELLBOOK_CTA" : "Call To Arms", - "SPELLBOOK_CAVI" : "Cave-In", - "SPELLBOOK_HEAL" : "Heal", - "SPELLBOOK_HLDAUD" : "Hold Audience", - "SPELLBOOK_LIGHTN" : "Lightning Strike", - "SPELLBOOK_SPDC" : "Speed Monster", - "SPELLBOOK_PROT" : "Protect Monster", - "SPELLBOOK_CONCL" : "Conceal Monster", - "CTA_ENSIGN" : "Cta Ensign", - "ROOM_FLAG" : "Room Flag", - "ANVIL" : "Anvil", - "PRISON_BAR" : "Prison Bar", - "CANDLESTCK" : "Candlestick", - "GRAVE_STONE" : "Gravestone", - "STATUE_HORNY" : "Aztec Statue", - "TRAINING_POST" : "Training Post", - "TORTURE_SPIKE" : "Torture Spike", - "TEMPLE_SPANGLE" : "Temple Spangle", - "POTION_PURPLE" : "Purple Potion", - "POTION_BLUE" : "Blue Potion", - "POTION_GREEN" : "Green Potion", - "POWER_HAND" : "Power Hand", - "POWER_HAND_GRAB" : "Power Hand Grab", - "POWER_HAND_WHIP" : "Power Hand Whip", - "CHICKEN_STB" : "Egg Stable (2)", - "CHICKEN_WOB" : "Egg Wobbling (3)", - "CHICKEN_CRK" : "Egg Cracking (4)", - "GOLDL" : "Gold Pile (200)", - "SPINNING_KEY" : "Spinning Key", - "SPELLBOOK_DISEASE" : "Disease", - "SPELLBOOK_CHKN" : "Chicken Spell", - "SPELLBOOK_DWAL" : "Destroy Walls", - "SPELLBOOK_TBMB" : "Time Bomb", - "HERO_GATE" : "Hero Gate", - "SPINNING_KEY2" : "Spinning Key 2", - "ARMOUR" : "Armour Effect", - "GOLD_HOARD_1" : "Treasury Hoard 1 (400)", - "GOLD_HOARD_2" : "Treasury Hoard 2 (800)", - "GOLD_HOARD_3" : "Treasury Hoard 3 (1200)", - "GOLD_HOARD_4" : "Treasury Hoard 4 (1600)", - "GOLD_HOARD_5" : "Treasury Hoard 5 (2000)", - "LAIR_WIZRD" : "Wizard Lair", - "LAIR_BARBR" : "Barbarian Lair", - "LAIR_ARCHR" : "Archer Lair", - "LAIR_MONK" : "Monk Lair", - "LAIR_DWRFA" : "Dwarf Lair", - "LAIR_KNGHT" : "Knight Lair", - "LAIR_AVATR" : "Avatar Lair", - "LAIR_TUNLR" : "Tunneller Lair", - "LAIR_WITCH" : "Witch Lair", - "LAIR_GIANT" : "Giant Lair", - "LAIR_FAIRY" : "Fairy Lair", - "LAIR_THIEF" : "Thief Lair", - "LAIR_SAMUR" : "Samurai Lair", - "LAIR_HORNY" : "Horned Reaper Lair", - "LAIR_SKELT" : "Skeleton Lair", - "LAIR_GOBLN" : "Troll Lair", - "LAIR_DRAGN" : "Dragon Lair", - "LAIR_DEMSP" : "Demon Spawn Lair", - "LAIR_FLY" : "Fly Lair", - "LAIR_DKMIS" : "Mistress Lair", - "LAIR_SORCR" : "Warlock Lair", - "LAIR_BILDM" : "Bile Demon Lair", - "LAIR_IMP" : "Imp Lair", - "LAIR_BUG" : "Beetle Lair", - "LAIR_VAMP" : "Vampire Lair", - "LAIR_SPIDR" : "Spider Lair", - "LAIR_HLHND" : "Hell Hound Lair", - "LAIR_GHOST" : "Ghost Lair", - "LAIR_TENTC" : "Tentacle Lair", - "SPECBOX_REVMAP" : "Reveal Map", - "SPECBOX_RESURCT" : "Resurrect Creature", - "SPECBOX_TRANSFR" : "Transfer Creature", - "SPECBOX_STEALHR" : "Steal Hero", - "SPECBOX_MULTPLY" : "Multiply Creatures", - "SPECBOX_INCLEV" : "Increase Level", - "SPECBOX_MKSAFE" : "Make Safe", - "SPECBOX_HIDNWRL" : "Locate Hidden World", - "WRKBOX_BOULDER" : "Box: Boulder Trap", - "WRKBOX_ALARM" : "Box: Alarm Trap", - "WRKBOX_POISONG" : "Box: Poison Gas Trap", - "WRKBOX_LIGHTNG" : "Box: Lightning Trap", - "WRKBOX_WRDOFPW" : "Box: Word of Power Trap", - "WRKBOX_LAVA" : "Box: Lava Trap", - "WRKBOX_DEMOLTN" : "Box: Dummy Trap 2", - "WRKBOX_DUMMY3" : "Box: Dummy Trap 3", - "WRKBOX_DUMMY4" : "Box: Dummy Trap 4", - "WRKBOX_DUMMY5" : "Box: Dummy Trap 5", - "WRKBOX_DUMMY6" : "Box: Dummy Trap 6", - "WRKBOX_DUMMY7" : "Box: Dummy Trap 7", - "WRKBOX_WOOD" : "Box: Wooden Door", - "WRKBOX_BRACE" : "Box: Braced Door", - "WRKBOX_STEEL" : "Box: Iron Door", - "WRKBOX_MAGIC" : "Box: Magic Door", - "WRKBOX_ITEM" : "Workshop Item", - "HEARTFLAME_RED" : "Red Heart Flame", - "DISEASE" : "Disease Effect", - "SCAVENGE_EYE" : "Scavenger Eye", - "WORKSHOP_MACHINE" : "Workshop Machine", - "GUARDFLAG_RED" : "Red Flag", - "GUARDFLAG_BLUE" : "Blue Flag", - "GUARDFLAG_GREEN" : "Green Flag", - "GUARDFLAG_YELLOW" : "Yellow Flag", - "FLAG_POST" : "Flagpole", - "HEARTFLAME_BLUE" : "Blue Heart Flame", - "HEARTFLAME_GREEN" : "Green Heart Flame", - "HEARTFLAME_YELLOW" : "Yellow Heart Flame", - "POWER_SIGHT" : "Casted Sight", - "POWER_LIGHTNG" : "Casted Lightning", - "TORTURER" : "Torturer", - "LAIR_ORC" : "Orc Lair", - "POWER_HAND_GOLD" : "Power Hand Gold", - "SPINNCOIN" : "Spinning Coin", - "STATUE2" : "Unlit Statue", - "STATUE3" : "Statue 3", - "STATUE4" : "Statue 4", - "STATUE5" : "Statue 5", - "SPECBOX_CUSTOM" : "Mysterious Box", - "SPELLBOOK_ARMG" : "Armageddon Spell", - "SPELLBOOK_POSS" : "Possess Spell", - "GOLD_BAG" : "Gold Bag", - "FERN" : "Fern", - "FERN_BROWN" : "Brown Fern", - "FERN_SMALL" : "Small Fern", - "FERN_SMALL_BROWN" : "Small Brown Fern", - "MUSHROOM_YELLOW" : "Yellow Mushroom", - "MUSHROOM_GREEN" : "Green Mushroom", - "MUSHROOM_RED" : "Red Mushroom", - "LAIR_TMAGE" : "Time Mage Lair", - "LAIR_DRUID" : "Druid Lair", - "LILYPAD" : "Lilypad", - "CATTAILS" : "Cattails", - "BANNER" : "Banner", - "LANTERN_PST" : "Lantern Post", - "POTION_RED" : "Red Potion", - "POTION_BROWN" : "Brown Potion", - "POTION_WHITE" : "White Potion", - "POTION_YELLOW" : "Yellow Potion", - "ROCK_PILLAR" : "Rock Pillar", - "ROCK" : "Rock", - "LAVA_PILLAR" : "Lava Pillar", - "LAVA_ROCK" : "Lava Rock", - "ICE_PILLAR" : "Ice Pillar", - "ICE_ROCK" : "Ice Rock", - "WRKBOX_SECRET" : "Box: Secret Door", - "GUARDFLAG_WHITE" : "White Flag", - "HEARTFLAME_WHITE" : "White Heart Flame", - "SPELLBOOK_RBND" : "Rebound", - "GUARDFLAG_PURPLE" : "Purple Flag", - "HEARTFLAME_PURPLE" : "Purple Heart Flame", - "GUARDFLAG_BLACK" : "Black Flag", - "HEARTFLAME_BLACK" : "Black Heart Flame", - "GUARDFLAG_ORANGE" : "Orange Flag", - "HEARTFLAME_ORANGE" : "Orange Heart Flame", - "SPECBOX_HEALALL" : "Heal All", - "SPECBOX_GETGOLD" : "Increase Gold", - "SPECBOX_MKANGRY" : "Make Unhappy", - "SPECBOX_MKUNSAFE" : "Weaken Walls", - "SPELLBOOK_FRZ" : "Freeze", - "SPELLBOOK_SLOW" : "Slow", - "SPELLBOOK_FLGT" : "Flight", - "SPELLBOOK_VSN" : "Vision" - } -} - var data_structure_name = { TYPE.NONE: "Empty", TYPE.OBJECT: "Object", @@ -334,6 +84,7 @@ var data_structure_name = { TYPE.EXTRA: "Extra" } + var reverse_data_structure_name = { "Empty": TYPE.NONE, "Object":TYPE.OBJECT, @@ -352,6 +103,7 @@ var reverse_data_structure_name = { "Extra":TYPE.EXTRA, } + enum { # I only used the official DK keeperfx categories as a guide rather than strict adherence. What strict adherence gets you is all the egg objects classified as Furniture, while Chicken sits alone in its own Food category. TAB_ACTION TAB_CREATURE @@ -367,6 +119,7 @@ enum { # I only used the official DK keeperfx categories as a guide rather than TAB_MISC } + var GENRE_TO_TAB = { "DECORATION": TAB_DECORATION, "EFFECT": TAB_EFFECTGEN, @@ -381,228 +134,6 @@ var GENRE_TO_TAB = { "WORKSHOPBOX": TAB_BOX, } -var DATA_EXTRA = { -0 : [null, null, null, null], -1 : ["ACTIONPOINT", "IMG_ACTIONPOINT", null, TAB_ACTION], -2 : ["LIGHT", "IMG_LIGHT", null, TAB_EFFECTGEN], -} - -var DATA_DOOR = { # -0 : [null, null, null, null], -1 : ["WOOD", "IMG_WOOD" , null, TAB_MISC], -2 : ["BRACED", "IMG_BRACED", null, TAB_MISC], -3 : ["STEEL", "IMG_STEEL", null, TAB_MISC], -4 : ["MAGIC", "IMG_MAGIC", null, TAB_MISC] -} - -var DATA_TRAP = { -00 : [null, null, null, null], -01 : ["BOULDER", "IMG_BOULDER", null, TAB_TRAP], -02 : ["ALARM", "IMG_ALARM", null, TAB_TRAP], -03 : ["POISON_GAS", "IMG_POISON_GAS", null, TAB_TRAP], -04 : ["LIGHTNING", "IMG_LIGHTNING_TRAP", null, TAB_TRAP], -05 : ["WORD_OF_POWER", "IMG_WORD_OF_POWER", null, TAB_TRAP], -06 : ["LAVA", "IMG_LAVA", null, TAB_TRAP], -07 : ["TNT", "IMG_TNT", null, TAB_TRAP], -08 : ["DUMMYTRAP3", null, null, null, TAB_TRAP], -09 : ["DUMMYTRAP4", null, null, null, TAB_TRAP], -10 : ["DUMMYTRAP5", null, null, null, TAB_TRAP], -11 : ["DUMMYTRAP6", null, null, null, TAB_TRAP], -12 : ["DUMMYTRAP7", null, null, null, TAB_TRAP], -} - -var DATA_EFFECTGEN = { -0 : [null, null, null, null], -1 : ["EFFECTGENERATOR_LAVA", "IMG_EFFECTGENERATOR_LAVA", null, TAB_EFFECTGEN], -2 : ["EFFECTGENERATOR_DRIPPING_WATER", "IMG_EFFECTGENERATOR_DRIPPING_WATER", null, TAB_EFFECTGEN], -3 : ["EFFECTGENERATOR_ROCK_FALL", "IMG_EFFECTGENERATOR_ROCK_FALL", null, TAB_EFFECTGEN], -4 : ["EFFECTGENERATOR_ENTRANCE_ICE", "IMG_EFFECTGENERATOR_ENTRANCE_ICE", null, TAB_EFFECTGEN], -5 : ["EFFECTGENERATOR_DRY_ICE", "IMG_EFFECTGENERATOR_DRY_ICE", null, TAB_EFFECTGEN] -} - -var DATA_CREATURE = { -00 : [null, null, null, null], -01 : ["WIZARD", "IMG_WIZARD", "IMG_WIZARD_PORTRAIT", TAB_CREATURE], -02 : ["BARBARIAN", "IMG_BARBARIAN", "IMG_BARBARIAN_PORTRAIT", TAB_CREATURE], -03 : ["ARCHER", "IMG_ARCHER", "IMG_ARCHER_PORTRAIT", TAB_CREATURE], -04 : ["MONK", "IMG_MONK", "IMG_MONK_PORTRAIT", TAB_CREATURE], -05 : ["DWARFA", "IMG_DWARFA", "IMG_DWARFA_PORTRAIT", TAB_CREATURE], -06 : ["KNIGHT", "IMG_KNIGHT", "IMG_KNIGHT_PORTRAIT", TAB_CREATURE], -07 : ["AVATAR", "IMG_AVATAR", "IMG_AVATAR_PORTRAIT", TAB_CREATURE], -08 : ["TUNNELLER", "IMG_TUNNELLER", "IMG_TUNNELLER_PORTRAIT", TAB_CREATURE], -09 : ["WITCH", "IMG_WITCH", "IMG_WITCH_PORTRAIT", TAB_CREATURE], -10 : ["GIANT", "IMG_GIANT", "IMG_GIANT_PORTRAIT", TAB_CREATURE], -11 : ["FAIRY", "IMG_FAIRY", "IMG_FAIRY_PORTRAIT", TAB_CREATURE], -12 : ["THIEF", "IMG_THIEF", "IMG_THIEF_PORTRAIT", TAB_CREATURE], -13 : ["SAMURAI", "IMG_SAMURAI", "IMG_SAMURAI_PORTRAIT", TAB_CREATURE], -14 : ["HORNY", "IMG_HORNY", "IMG_HORNY_PORTRAIT", TAB_CREATURE], -15 : ["SKELETON", "IMG_SKELETON", "IMG_SKELETON_PORTRAIT", TAB_CREATURE], -16 : ["TROLL", "IMG_TROLL", "IMG_TROLL_PORTRAIT", TAB_CREATURE], -17 : ["DRAGON", "IMG_DRAGON", "IMG_DRAGON_PORTRAIT", TAB_CREATURE], -18 : ["DEMONSPAWN", "IMG_DEMONSPAWN", "IMG_DEMONSPAWN_PORTRAIT", TAB_CREATURE], -19 : ["FLY", "IMG_FLY", "IMG_FLY_PORTRAIT", TAB_CREATURE], -20 : ["DARK_MISTRESS", "IMG_DARK_MISTRESS", "IMG_DARK_MISTRESS_PORTRAIT", TAB_CREATURE], -21 : ["SORCEROR", "IMG_SORCEROR", "IMG_SORCEROR_PORTRAIT", TAB_CREATURE], -22 : ["BILE_DEMON", "IMG_BILE_DEMON", "IMG_BILE_DEMON_PORTRAIT", TAB_CREATURE], -23 : ["IMP", "IMG_IMP", "IMG_IMP_PORTRAIT", TAB_CREATURE], -24 : ["BUG", "IMG_BUG", "IMG_BUG_PORTRAIT", TAB_CREATURE], -25 : ["VAMPIRE", "IMG_VAMPIRE", "IMG_VAMPIRE_PORTRAIT", TAB_CREATURE], -26 : ["SPIDER", "IMG_SPIDER", "IMG_SPIDER_PORTRAIT", TAB_CREATURE], -27 : ["HELL_HOUND", "IMG_HELL_HOUND", "IMG_HELL_HOUND_PORTRAIT", TAB_CREATURE], -28 : ["GHOST", "IMG_GHOST", "IMG_GHOST_PORTRAIT", TAB_CREATURE], -29 : ["TENTACLE", "IMG_TENTACLE", "IMG_TENTACLE_PORTRAIT", TAB_CREATURE], -30 : ["ORC", "IMG_ORC", "IMG_ORC_PORTRAIT", TAB_CREATURE], -31 : ["FLOATING_SPIRIT", "IMG_FLOATING_SPIRIT", "IMG_FLOATING_SPIRIT_PORTRAIT", TAB_CREATURE], # wrong icon probably -} - -var DATA_OBJECT = { -000 : [null, null, null, null], -001 : ["BARREL", 930, null, TAB_DECORATION], -002 : ["TORCH", 962, null, TAB_DECORATION], #TAB_FURNITURE -003 : ["GOLD_CHEST", 934, null, TAB_GOLD], -004 : ["TEMPLE_STATUE", 950, null, TAB_DECORATION], #TAB_FURNITURE -005 : ["SOUL_CONTAINER", 948, null, TAB_FURNITURE], -006 : ["GOLD", 934, null, TAB_GOLD], -007 : ["TORCHUN", 962, null, TAB_DECORATION], #TAB_FURNITURE -008 : ["STATUEWO", 950, null, TAB_DECORATION], #Lit Statue No Flame # Partially Lit Statue -009 : ["CHICKEN_GRW", 893, null, TAB_MISC], -010 : ["CHICKEN_MAT", 819, null, TAB_MISC], -011 : ["SPELLBOOK_HOE", "IMG_HAND_OF_EVIL", null, TAB_SPELL], -012 : ["SPELLBOOK_IMP", "IMG_IMP", null, TAB_SPELL], -013 : ["SPELLBOOK_OBEY", "IMG_MUST_OBEY", null, TAB_SPELL], -014 : ["SPELLBOOK_SLAP", "IMG_SLAP", null, TAB_SPELL], -015 : ["SPELLBOOK_SOE", "IMG_SIGHT_OF_EVIL", null, TAB_SPELL], -016 : ["SPELLBOOK_CTA", "IMG_CALL_TO_ARMS", null, TAB_SPELL], -017 : ["SPELLBOOK_CAVI", "IMG_CAVE_IN", null, TAB_SPELL], -018 : ["SPELLBOOK_HEAL", "IMG_HEAL_CREATURE", null, TAB_SPELL], -019 : ["SPELLBOOK_HLDAUD", "IMG_HOLD_AUDIENCE", null, TAB_SPELL], -020 : ["SPELLBOOK_LIGHTN", "IMG_LIGHTNING", null, TAB_SPELL], -021 : ["SPELLBOOK_SPDC", "IMG_SPEED_CREATURE", null, TAB_SPELL], -022 : ["SPELLBOOK_PROT", "IMG_PROTECT_CREATURE", null, TAB_SPELL], -023 : ["SPELLBOOK_CONCL", "IMG_CONCEAL_CREATURE", null, TAB_SPELL], -024 : ["CTA_ENSIGN", null, null, TAB_MISC], -025 : ["ROOM_FLAG", null, null, TAB_MISC], -026 : ["ANVIL", 789, null, TAB_FURNITURE], -027 : ["PRISON_BAR", 796, null, TAB_FURNITURE], -028 : ["CANDLESTCK", 791, null, TAB_DECORATION], #TAB_FURNITURE -029 : ["GRAVE_STONE", 793, null, TAB_FURNITURE], -030 : ["STATUE_HORNY", 905, null, TAB_DECORATION], #TAB_FURNITURE -031 : ["TRAINING_POST", 795, null, TAB_FURNITURE], -032 : ["TORTURE_SPIKE", 892, null, TAB_FURNITURE], -033 : ["TEMPLE_SPANGLE", 797, null, TAB_DECORATION], -034 : ["POTION_PURPLE", 804, null, TAB_DECORATION], -035 : ["POTION_BLUE", 806, null, TAB_DECORATION], -036 : ["POTION_GREEN", 808, null, TAB_DECORATION], -037 : ["POWER_HAND", 782, null, TAB_MISC], -038 : ["POWER_HAND_GRAB", 783, null, TAB_MISC], -039 : ["POWER_HAND_WHIP", 785, null, TAB_MISC], -040 : ["CHICKEN_STB", 894, null, TAB_MISC], -041 : ["CHICKEN_WOB", 895, null, TAB_MISC], -042 : ["CHICKEN_CRK", 896, null, TAB_MISC], -043 : ["GOLDL", 936, null, TAB_GOLD], -044 : ["SPINNING_KEY", 810, null, TAB_MISC], -045 : ["SPELLBOOK_DISEASE", "IMG_DISEASE", null, TAB_SPELL], -046 : ["SPELLBOOK_CHKN", "IMG_CHICKEN", null, TAB_SPELL], -047 : ["SPELLBOOK_DWAL", "IMG_DESTROY_WALLS", null, TAB_SPELL], -048 : ["SPELLBOOK_TBMB", "IMG_TIME_BOMB", null, TAB_SPELL], -049 : ["HERO_GATE", 776, null, TAB_ACTION], -050 : ["SPINNING_KEY2", 810, null, TAB_MISC], -051 : ["ARMOUR", null, null, TAB_MISC], -052 : ["GOLD_HOARD_1", 936, null, TAB_GOLD], -053 : ["GOLD_HOARD_2", 937, null, TAB_GOLD], -054 : ["GOLD_HOARD_3", 938, null, TAB_GOLD], -055 : ["GOLD_HOARD_4", 939, null, TAB_GOLD], -056 : ["GOLD_HOARD_5", 940, null, TAB_GOLD], -057 : ["LAIR_WIZRD", 124, null, TAB_LAIR], -058 : ["LAIR_BARBR", 124, null, TAB_LAIR], -059 : ["LAIR_ARCHR", 124, null, TAB_LAIR], -060 : ["LAIR_MONK", 124, null, TAB_LAIR], -061 : ["LAIR_DWRFA", 124, null, TAB_LAIR], -062 : ["LAIR_KNGHT", 124, null, TAB_LAIR], -063 : ["LAIR_AVATR", 124, null, TAB_LAIR], -064 : ["LAIR_TUNLR", 124, null, TAB_LAIR], -065 : ["LAIR_WITCH", 124, null, TAB_LAIR], -066 : ["LAIR_GIANT", 124, null, TAB_LAIR], -067 : ["LAIR_FAIRY", 124, null, TAB_LAIR], -068 : ["LAIR_THIEF", 124, null, TAB_LAIR], -069 : ["LAIR_SAMUR", 124, null, TAB_LAIR], -070 : ["LAIR_HORNY", 158, null, TAB_LAIR], -071 : ["LAIR_SKELT", 156, null, TAB_LAIR], -072 : ["LAIR_GOBLN", 154, null, TAB_LAIR], -073 : ["LAIR_DRAGN", 152, null, TAB_LAIR], -074 : ["LAIR_DEMSP", 150, null, TAB_LAIR], -075 : ["LAIR_FLY", 148, null, TAB_LAIR], -076 : ["LAIR_DKMIS", 146, null, TAB_LAIR], -077 : ["LAIR_SORCR", 144, null, TAB_LAIR], -078 : ["LAIR_BILDM", 142, null, TAB_LAIR], -079 : ["LAIR_IMP", 152, null, TAB_LAIR], -080 : ["LAIR_BUG", 140, null, TAB_LAIR], -081 : ["LAIR_VAMP", 138, null, TAB_LAIR], -082 : ["LAIR_SPIDR", 136, null, TAB_LAIR], -083 : ["LAIR_HLHND", 134, null, TAB_LAIR], -084 : ["LAIR_GHOST", 132, null, TAB_LAIR], -085 : ["LAIR_TENTC", 128, null, TAB_LAIR], -086 : ["SPECBOX_REVMAP", 901, null, TAB_SPECIAL], -087 : ["SPECBOX_RESURCT", 901, null, TAB_SPECIAL], -088 : ["SPECBOX_TRANSFR", 901, null, TAB_SPECIAL], -089 : ["SPECBOX_STEALHR", 901, null, TAB_SPECIAL], -090 : ["SPECBOX_MULTPLY", 901, null, TAB_SPECIAL], -091 : ["SPECBOX_INCLEV", 901, null, TAB_SPECIAL], -092 : ["SPECBOX_MKSAFE", 901, null, TAB_SPECIAL], -093 : ["SPECBOX_HIDNWRL", 901, null, TAB_SPECIAL], -094 : ["WRKBOX_BOULDER", 114, null, TAB_BOX], -095 : ["WRKBOX_ALARM", 114, null, TAB_BOX], -096 : ["WRKBOX_POISONG", 114, null, TAB_BOX], -097 : ["WRKBOX_LIGHTNG", 114, null, TAB_BOX], -098 : ["WRKBOX_WRDOFPW", 114, null, TAB_BOX], -099 : ["WRKBOX_LAVA", 114, null, TAB_BOX], -100 : ["WRKBOX_DEMOLTN", 114, null, TAB_BOX], -101 : ["WRKBOX_DUMMY3", 114, null, TAB_BOX], -102 : ["WRKBOX_DUMMY4", 114, null, TAB_BOX], -103 : ["WRKBOX_DUMMY5", 114, null, TAB_BOX], -104 : ["WRKBOX_DUMMY6", 114, null, TAB_BOX], -105 : ["WRKBOX_DUMMY7", 114, null, TAB_BOX], -106 : ["WRKBOX_WOOD", 114, null, TAB_BOX], -107 : ["WRKBOX_BRACE", 114, null, TAB_BOX], -108 : ["WRKBOX_STEEL", 114, null, TAB_BOX], -109 : ["WRKBOX_MAGIC", 114, null, TAB_BOX], -110 : ["WRKBOX_ITEM", 789, null, TAB_MISC], -111 : ["HEARTFLAME_RED", 798, null, TAB_FURNITURE], -112 : ["DISEASE", null, null, TAB_MISC], -113 : ["SCAVENGE_EYE", 130, null, TAB_FURNITURE], -114 : ["WORKSHOP_MACHINE", 98, null, TAB_FURNITURE], -115 : ["GUARDFLAG_RED", 102, null, TAB_FURNITURE], -116 : ["GUARDFLAG_BLUE", 104, null, TAB_FURNITURE], -117 : ["GUARDFLAG_GREEN", 106, null, TAB_FURNITURE], -118 : ["GUARDFLAG_YELLOW", 108, null, TAB_FURNITURE], -119 : ["FLAG_POST", 100, null, TAB_FURNITURE], -120 : ["HEARTFLAME_BLUE", 799, null, TAB_FURNITURE], -121 : ["HEARTFLAME_GREEN", 800, null, TAB_FURNITURE], -122 : ["HEARTFLAME_YELLOW", 801, null, TAB_FURNITURE], -123 : ["POWER_SIGHT", "IMG_POWER_SIGHT", null, TAB_MISC], -124 : ["POWER_LIGHTNG", null, null, TAB_MISC], -125 : ["TORTURER", 46, null, TAB_FURNITURE], -126 : ["LAIR_ORC", 126, null, TAB_LAIR], -127 : ["POWER_HAND_GOLD", 781, null, TAB_MISC], -128 : ["SPINNCOIN", null, null, TAB_MISC], -129 : ["STATUE2", 952, null, TAB_DECORATION], -130 : ["STATUE3", "GOLDEN_ARMOR", null, TAB_DECORATION], -131 : ["STATUE4", "KNIGHTSTATUE", null, TAB_DECORATION], -132 : ["STATUE5", 958, null, TAB_DECORATION], -133 : ["SPECBOX_CUSTOM", 901, null, TAB_SPECIAL], -134 : ["SPELLBOOK_ARMG", "IMG_ARMAGEDDON", null, TAB_SPELL], -135 : ["SPELLBOOK_POSS", "IMG_POSSESS_CREATURE", null, TAB_SPELL], -} - -#136 : ["Gold Bag (100)", null, preload("res://dk_images/valuables/gold_sack_tp/r1frame01.png"), null, TAB_GOLD], -#161 : ["White Flag", null, preload("res://dk_images/furniture/flagpole_whiteflag_tp/AnimFlagpoleWhite.tres"), null, TAB_FURNITURE], -#162 : ["White Heart Flame", null, preload("res://edited_images/heartflames/heartflame_white/AnimWhiteHeartFlame.tres"), null, TAB_FURNITURE], -#164 : ["Purple Flag", null, preload("res://dk_images/furniture/flagpole_purpleflag_tp/AnimFlagpolePurple.tres"), null, TAB_FURNITURE], -#165 : ["Purple Heart Flame", null, preload("res://edited_images/heartflames/heartflame_purple/AnimPurpleHeartFlame.tres"), null, TAB_FURNITURE], -#166 : ["Black Flag", null, preload("res://dk_images/furniture/flagpole_blackflag_tp/AnimFlagpoleBlack.tres"), null, TAB_FURNITURE], -#167 : ["Black Heart Flame", null, preload("res://edited_images/heartflames/heartflame_black/AnimBlackHeartFlame.tres"), null, TAB_FURNITURE], -#168 : ["Orange Flag", null, preload("res://dk_images/furniture/flagpole_orangeflag_tp/AnimFlagpoleOrange.tres"), null, TAB_FURNITURE], -#169 : ["Orange Heart Flame", null, preload("res://edited_images/heartflames/heartflame_orange/AnimOrangeHeartFlame.tres"), null, TAB_FURNITURE], func data_structure(thingType): match thingType: @@ -615,6 +146,7 @@ func data_structure(thingType): print("This should never happen.") return {} + var LIST_OF_BOXES = { 094 : [TYPE.TRAP, 1], # Boulder Trap 095 : [TYPE.TRAP, 2], # Alarm Trap @@ -633,10 +165,13 @@ var LIST_OF_BOXES = { 108 : [TYPE.DOOR, 3], # Iron Door 109 : [TYPE.DOOR, 4], # Magic Door } + + var LIST_OF_GOLDPILES = [ 3, 6, 43, 128, 136 ] + var LIST_OF_SPELLBOOKS = [ SPELLBOOK.HAND, SPELLBOOK.SLAP, @@ -686,13 +221,220 @@ var collectible_belonging = { TAB_BOX : Slabs.WORKSHOP, } - #OBJECT = 1 - #CREATURE = 5 - #EFFECT = 7 - #TRAP = 8 - #DOOR = 9 - func convert_relative_256_to_float(datnum): if datnum >= 32768: # If the sign bit is set (indicating a negative value) datnum -= 65536 # Convert to signed by subtracting 2^16 return datnum / 256.0 # Scale it to floating-point + +var DATA_EXTRA = { +0 : [null, null, null, null], +1 : ["ACTIONPOINT", "ACTIONPOINT", TAB_ACTION], +2 : ["LIGHT", "LIGHT", TAB_EFFECTGEN], +} + +var DATA_DOOR = { # +0 : [null, null, null], +1 : ["WOOD", "WOOD" , TAB_MISC], +2 : ["BRACED", "BRACED", TAB_MISC], +3 : ["STEEL", "STEEL", TAB_MISC], +4 : ["MAGIC", "MAGIC", TAB_MISC] +} + +var DATA_TRAP = { +00 : [null, null, null], +01 : ["BOULDER", "BOULDER", TAB_TRAP], +02 : ["ALARM", "ALARM", TAB_TRAP], +03 : ["POISON_GAS", "POISON_GAS", TAB_TRAP], +04 : ["LIGHTNING", "LIGHTNING_TRAP", TAB_TRAP], +05 : ["WORD_OF_POWER", "WORD_OF_POWER", TAB_TRAP], +06 : ["LAVA", "LAVA", TAB_TRAP], +07 : ["TNT", "TNT", TAB_TRAP], +08 : ["DUMMYTRAP3", null, TAB_TRAP], +09 : ["DUMMYTRAP4", null, TAB_TRAP], +10 : ["DUMMYTRAP5", null, TAB_TRAP], +11 : ["DUMMYTRAP6", null, TAB_TRAP], +12 : ["DUMMYTRAP7", null, TAB_TRAP], +} + +var DATA_EFFECTGEN = { +0 : [null, null, null], +1 : ["EFFECTGENERATOR_LAVA", "EFFECTGENERATOR_LAVA", TAB_EFFECTGEN], +2 : ["EFFECTGENERATOR_DRIPPING_WATER", "EFFECTGENERATOR_DRIPPING_WATER", TAB_EFFECTGEN], +3 : ["EFFECTGENERATOR_ROCK_FALL", "EFFECTGENERATOR_ROCK_FALL", TAB_EFFECTGEN], +4 : ["EFFECTGENERATOR_ENTRANCE_ICE", "EFFECTGENERATOR_ENTRANCE_ICE", TAB_EFFECTGEN], +5 : ["EFFECTGENERATOR_DRY_ICE", "EFFECTGENERATOR_DRY_ICE", TAB_EFFECTGEN] +} + +var DATA_CREATURE = { +00 : [null, null, null], +01 : ["WIZARD", "WIZARD", TAB_CREATURE], +02 : ["BARBARIAN", "BARBARIAN", TAB_CREATURE], +03 : ["ARCHER", "ARCHER", TAB_CREATURE], +04 : ["MONK", "MONK", TAB_CREATURE], +05 : ["DWARFA", "DWARFA", TAB_CREATURE], +06 : ["KNIGHT", "KNIGHT", TAB_CREATURE], +07 : ["AVATAR", "AVATAR", TAB_CREATURE], +08 : ["TUNNELLER", "TUNNELLER", TAB_CREATURE], +09 : ["WITCH", "WITCH", TAB_CREATURE], +10 : ["GIANT", "GIANT", TAB_CREATURE], +11 : ["FAIRY", "FAIRY", TAB_CREATURE], +12 : ["THIEF", "THIEF", TAB_CREATURE], +13 : ["SAMURAI", "SAMURAI", TAB_CREATURE], +14 : ["HORNY", "HORNY", TAB_CREATURE], +15 : ["SKELETON", "SKELETON", TAB_CREATURE], +16 : ["TROLL", "TROLL", TAB_CREATURE], +17 : ["DRAGON", "DRAGON", TAB_CREATURE], +18 : ["DEMONSPAWN", "DEMONSPAWN", TAB_CREATURE], +19 : ["FLY", "FLY", TAB_CREATURE], +20 : ["DARK_MISTRESS", "DARK_MISTRESS", TAB_CREATURE], +21 : ["SORCEROR", "SORCEROR", TAB_CREATURE], +22 : ["BILE_DEMON", "BILE_DEMON", TAB_CREATURE], +23 : ["IMP", "IMP", TAB_CREATURE], +24 : ["BUG", "BUG", TAB_CREATURE], +25 : ["VAMPIRE", "VAMPIRE", TAB_CREATURE], +26 : ["SPIDER", "SPIDER", TAB_CREATURE], +27 : ["HELL_HOUND", "HELL_HOUND", TAB_CREATURE], +28 : ["GHOST", "GHOST", TAB_CREATURE], +29 : ["TENTACLE", "TENTACLE", TAB_CREATURE], +30 : ["ORC", "ORC", TAB_CREATURE], +31 : ["FLOATING_SPIRIT", "FLOATING_SPIRIT", TAB_CREATURE], +} + +var DATA_OBJECT = { +000 : [null, null, null], +001 : ["BARREL", 930, TAB_DECORATION], +002 : ["TORCH", 962, TAB_DECORATION], #TAB_FURNITURE +003 : ["GOLD_CHEST", 934, TAB_GOLD], +004 : ["TEMPLE_STATUE", 950, TAB_DECORATION], #TAB_FURNITURE +005 : ["SOUL_CONTAINER", 948, TAB_FURNITURE], +006 : ["GOLD", 934, TAB_GOLD], +007 : ["TORCHUN", 962, TAB_DECORATION], #TAB_FURNITURE +008 : ["STATUEWO", 950, TAB_DECORATION], #Lit Statue No Flame # Partially Lit Statue +009 : ["CHICKEN_GRW", 893, TAB_MISC], +010 : ["CHICKEN_MAT", 819, TAB_MISC], +011 : ["SPELLBOOK_HOE", "SPELLBOOK_HOE", TAB_SPELL], +012 : ["SPELLBOOK_IMP", "SPELLBOOK_IMP", TAB_SPELL], +013 : ["SPELLBOOK_OBEY", "SPELLBOOK_OBEY", TAB_SPELL], +014 : ["SPELLBOOK_SLAP", "SPELLBOOK_SLAP", TAB_SPELL], +015 : ["SPELLBOOK_SOE", "SPELLBOOK_SOE", TAB_SPELL], +016 : ["SPELLBOOK_CTA", "SPELLBOOK_CTA", TAB_SPELL], +017 : ["SPELLBOOK_CAVI", "SPELLBOOK_CAVI", TAB_SPELL], +018 : ["SPELLBOOK_HEAL", "SPELLBOOK_HEAL", TAB_SPELL], +019 : ["SPELLBOOK_HLDAUD", "SPELLBOOK_HLDAUD", TAB_SPELL], +020 : ["SPELLBOOK_LIGHTN", "SPELLBOOK_LIGHTN", TAB_SPELL], +021 : ["SPELLBOOK_SPDC", "SPELLBOOK_SPDC", TAB_SPELL], +022 : ["SPELLBOOK_PROT", "SPELLBOOK_PROT", TAB_SPELL], +023 : ["SPELLBOOK_CONCL", "SPELLBOOK_CONCL", TAB_SPELL], +024 : ["CTA_ENSIGN", null, TAB_MISC], +025 : ["ROOM_FLAG", null, TAB_MISC], +026 : ["ANVIL", 789, TAB_FURNITURE], +027 : ["PRISON_BAR", 796, TAB_FURNITURE], +028 : ["CANDLESTCK", 791, TAB_DECORATION], #TAB_FURNITURE +029 : ["GRAVE_STONE", 793, TAB_FURNITURE], +030 : ["STATUE_HORNY", 905, TAB_DECORATION], #TAB_FURNITURE +031 : ["TRAINING_POST", 795, TAB_FURNITURE], +032 : ["TORTURE_SPIKE", 892, TAB_FURNITURE], +033 : ["TEMPLE_SPANGLE", 797, TAB_DECORATION], +034 : ["POTION_PURPLE", 804, TAB_DECORATION], +035 : ["POTION_BLUE", 806, TAB_DECORATION], +036 : ["POTION_GREEN", 808, TAB_DECORATION], +037 : ["POWER_HAND", 782, TAB_MISC], +038 : ["POWER_HAND_GRAB", 783, TAB_MISC], +039 : ["POWER_HAND_WHIP", 785, TAB_MISC], +040 : ["CHICKEN_STB", 894, TAB_MISC], +041 : ["CHICKEN_WOB", 895, TAB_MISC], +042 : ["CHICKEN_CRK", 896, TAB_MISC], +043 : ["GOLDL", 936, TAB_GOLD], +044 : ["SPINNING_KEY", 810, TAB_MISC], +045 : ["SPELLBOOK_DISEASE", "SPELLBOOK_DISEASE", TAB_SPELL], +046 : ["SPELLBOOK_CHKN", "SPELLBOOK_CHKN", TAB_SPELL], +047 : ["SPELLBOOK_DWAL", "SPELLBOOK_DWAL", TAB_SPELL], +048 : ["SPELLBOOK_TBMB", "SPELLBOOK_TBMB", TAB_SPELL], +049 : ["HERO_GATE", 776, TAB_ACTION], +050 : ["SPINNING_KEY2", 810, TAB_MISC], +051 : ["ARMOUR", null, TAB_MISC], +052 : ["GOLD_HOARD_1", 936, TAB_GOLD], +053 : ["GOLD_HOARD_2", 937, TAB_GOLD], +054 : ["GOLD_HOARD_3", 938, TAB_GOLD], +055 : ["GOLD_HOARD_4", 939, TAB_GOLD], +056 : ["GOLD_HOARD_5", 940, TAB_GOLD], +057 : ["LAIR_WIZRD", 124, TAB_LAIR], +058 : ["LAIR_BARBR", 124, TAB_LAIR], +059 : ["LAIR_ARCHR", 124, TAB_LAIR], +060 : ["LAIR_MONK", 124, TAB_LAIR], +061 : ["LAIR_DWRFA", 124, TAB_LAIR], +062 : ["LAIR_KNGHT", 124, TAB_LAIR], +063 : ["LAIR_AVATR", 124, TAB_LAIR], +064 : ["LAIR_TUNLR", 124, TAB_LAIR], +065 : ["LAIR_WITCH", 124, TAB_LAIR], +066 : ["LAIR_GIANT", 124, TAB_LAIR], +067 : ["LAIR_FAIRY", 124, TAB_LAIR], +068 : ["LAIR_THIEF", 124, TAB_LAIR], +069 : ["LAIR_SAMUR", 124, TAB_LAIR], +070 : ["LAIR_HORNY", 158, TAB_LAIR], +071 : ["LAIR_SKELT", 156, TAB_LAIR], +072 : ["LAIR_GOBLN", 154, TAB_LAIR], +073 : ["LAIR_DRAGN", 152, TAB_LAIR], +074 : ["LAIR_DEMSP", 150, TAB_LAIR], +075 : ["LAIR_FLY", 148, TAB_LAIR], +076 : ["LAIR_DKMIS", 146, TAB_LAIR], +077 : ["LAIR_SORCR", 144, TAB_LAIR], +078 : ["LAIR_BILDM", 142, TAB_LAIR], +079 : ["LAIR_IMP", 152, TAB_LAIR], +080 : ["LAIR_BUG", 140, TAB_LAIR], +081 : ["LAIR_VAMP", 138, TAB_LAIR], +082 : ["LAIR_SPIDR", 136, TAB_LAIR], +083 : ["LAIR_HLHND", 134, TAB_LAIR], +084 : ["LAIR_GHOST", 132, TAB_LAIR], +085 : ["LAIR_TENTC", 128, TAB_LAIR], +086 : ["SPECBOX_REVMAP", 901, TAB_SPECIAL], +087 : ["SPECBOX_RESURCT", 901, TAB_SPECIAL], +088 : ["SPECBOX_TRANSFR", 901, TAB_SPECIAL], +089 : ["SPECBOX_STEALHR", 901, TAB_SPECIAL], +090 : ["SPECBOX_MULTPLY", 901, TAB_SPECIAL], +091 : ["SPECBOX_INCLEV", 901, TAB_SPECIAL], +092 : ["SPECBOX_MKSAFE", 901, TAB_SPECIAL], +093 : ["SPECBOX_HIDNWRL", 901, TAB_SPECIAL], +094 : ["WRKBOX_BOULDER", 114, TAB_BOX], +095 : ["WRKBOX_ALARM", 114, TAB_BOX], +096 : ["WRKBOX_POISONG", 114, TAB_BOX], +097 : ["WRKBOX_LIGHTNG", 114, TAB_BOX], +098 : ["WRKBOX_WRDOFPW", 114, TAB_BOX], +099 : ["WRKBOX_LAVA", 114, TAB_BOX], +100 : ["WRKBOX_DEMOLTN", 114, TAB_BOX], +101 : ["WRKBOX_DUMMY3", 114, TAB_BOX], +102 : ["WRKBOX_DUMMY4", 114, TAB_BOX], +103 : ["WRKBOX_DUMMY5", 114, TAB_BOX], +104 : ["WRKBOX_DUMMY6", 114, TAB_BOX], +105 : ["WRKBOX_DUMMY7", 114, TAB_BOX], +106 : ["WRKBOX_WOOD", 114, TAB_BOX], +107 : ["WRKBOX_BRACE", 114, TAB_BOX], +108 : ["WRKBOX_STEEL", 114, TAB_BOX], +109 : ["WRKBOX_MAGIC", 114, TAB_BOX], +110 : ["WRKBOX_ITEM", 789, TAB_MISC], +111 : ["HEARTFLAME_RED", 798, TAB_FURNITURE], +112 : ["DISEASE", null, TAB_MISC], +113 : ["SCAVENGE_EYE", 130, TAB_FURNITURE], +114 : ["WORKSHOP_MACHINE", 98, TAB_FURNITURE], +115 : ["GUARDFLAG_RED", 102, TAB_FURNITURE], +116 : ["GUARDFLAG_BLUE", 104, TAB_FURNITURE], +117 : ["GUARDFLAG_GREEN", 106, TAB_FURNITURE], +118 : ["GUARDFLAG_YELLOW", 108, TAB_FURNITURE], +119 : ["FLAG_POST", 100, TAB_FURNITURE], +120 : ["HEARTFLAME_BLUE", 799, TAB_FURNITURE], +121 : ["HEARTFLAME_GREEN", 800, TAB_FURNITURE], +122 : ["HEARTFLAME_YELLOW", 801, TAB_FURNITURE], +123 : ["POWER_SIGHT", "POWER_SIGHT", TAB_MISC], +124 : ["POWER_LIGHTNG", null, TAB_MISC], +125 : ["TORTURER", 46, TAB_FURNITURE], +126 : ["LAIR_ORC", 126, TAB_LAIR], +127 : ["POWER_HAND_GOLD", 781, TAB_MISC], +128 : ["SPINNCOIN", null, TAB_MISC], +129 : ["STATUE2", 952, TAB_DECORATION], +130 : ["STATUE3", "GOLDEN_ARMOR", TAB_DECORATION], +131 : ["STATUE4", "KNIGHTSTATUE", TAB_DECORATION], +132 : ["STATUE5", 958, TAB_DECORATION], +133 : ["SPECBOX_CUSTOM", 901, TAB_SPECIAL], +134 : ["SPELLBOOK_ARMG", "SPELLBOOK_ARMG", TAB_SPELL], +135 : ["SPELLBOOK_POSS", "SPELLBOOK_POSS", TAB_SPELL], +} diff --git a/Scenes/FxData.gd b/Scenes/FxData.gd index 2b1fc951..2822667c 100644 --- a/Scenes/FxData.gd +++ b/Scenes/FxData.gd @@ -43,6 +43,8 @@ func start(): creature_cfg = read_dkcfg_file(oGame.DK_FXDATA_DIRECTORY.plus_file("creature.cfg")) trapdoor_cfg = read_dkcfg_file(oGame.DK_FXDATA_DIRECTORY.plus_file("trapdoor.cfg")) print('Parsed all dkcfg files: ' + str(OS.get_ticks_msec() - CODETIME_START) + 'ms') + + var CODETIME_LOADCFG_START = OS.get_ticks_msec() for section in objects_cfg: @@ -50,22 +52,40 @@ func start(): var id = int(section) if id == 0: continue if id >= 136 or id in [100,101,102,103,104,105]: # Dummy Boxes should be overwritten - var newGenre = objects_cfg[section]["Genre"] + var newName = objects_cfg[section]["Name"] + + var animID = objects_cfg[section]["AnimationID"] var newSprite = null + if Graphics.sprite_id.has(animID): + newSprite = animID + elif Graphics.sprite_id.has(newName): + newSprite = newName + + var newGenre = objects_cfg[section].get("Genre", null) + var newEditorTab = Things.GENRE_TO_TAB[newGenre] + Things.DATA_OBJECT[id] = [ - objects_cfg[section]["Name"], # NAME + newName, # NAME newSprite, # SPRITE - null, # PORTRAIT - Things.GENRE_TO_TAB[newGenre], # EDITOR_TAB + newEditorTab, # EDITOR_TAB ] - print('Loaded objects.cfg: ' + str(OS.get_ticks_msec() - CODETIME_LOADCFG_START) + 'ms') for id_number in creature_cfg["common"]["Creatures"].size(): if Things.DATA_CREATURE.has(id_number+1) == false: + + var newName = creature_cfg["common"]["Creatures"][id_number] + + var newSprite = null + if Graphics.sprite_id.has(newName): + newSprite = newName + + var newPortrait = null + if Graphics.sprite_id.has(str(newSprite) + "_PORTRAIT"): + newPortrait = str(newSprite) + "_PORTRAIT" + Things.DATA_CREATURE[id_number+1] = [ - creature_cfg["common"]["Creatures"][id_number], # NAME - null, # SPRITE - null, # PORTRAIT + newName, # NAME + newSprite, # SPRITE Things.TAB_CREATURE, # EDITOR_TAB ] @@ -73,20 +93,26 @@ func start(): var id = int(section) if id == 0: continue if section.begins_with("door"): + var newName = trapdoor_cfg[section]["Name"] + var newSprite = null + if Graphics.sprite_id.has(newName): + newSprite = newName Things.DATA_DOOR[id] = [ - trapdoor_cfg[section]["Name"], # NAME - null, # SPRITE - null, # PORTRAIT + newName, # NAME + newSprite, # SPRITE Things.TAB_MISC, # EDITOR_TAB ] - if section.begins_with("trap"): + elif section.begins_with("trap"): + var newName = trapdoor_cfg[section]["Name"] + var newSprite = null + if Graphics.sprite_id.has(newName): + newSprite = newName Things.DATA_TRAP[id] = [ - trapdoor_cfg[section]["Name"], # NAME - null, # SPRITE - null, # PORTRAIT + newName, # NAME + newSprite, # SPRITE Things.TAB_TRAP, # EDITOR_TAB ] - + print('Loaded things from cfg files: ' + str(OS.get_ticks_msec() - CODETIME_LOADCFG_START) + 'ms') func read_dkcfg_file(file_path) -> Dictionary: # Optimized var config = {} diff --git a/Scenes/OldCfgCode.gd b/Scenes/OldCfgCode.gd index f4f30c43..d923135d 100644 --- a/Scenes/OldCfgCode.gd +++ b/Scenes/OldCfgCode.gd @@ -332,7 +332,7 @@ func look_for_images_to_load(DATA_ARRAY, objectID, thingCfgName): if err == OK: var tex = ImageTexture.new() tex.create_from_image(img, Texture.FLAG_MIPMAPS+Texture.FLAG_ANISOTROPIC_FILTER) - DATA_ARRAY[objectID][Things.TEXTURE] = tex + #DATA_ARRAY[objectID][Things.TEXTURE] = tex if realPortraitFilename != "": var img = Image.new() @@ -340,7 +340,7 @@ func look_for_images_to_load(DATA_ARRAY, objectID, thingCfgName): if err == OK: var tex = ImageTexture.new() tex.create_from_image(img, Texture.FLAG_MIPMAPS+Texture.FLAG_ANISOTROPIC_FILTER) - DATA_ARRAY[objectID][Things.PORTRAIT] = tex + #DATA_ARRAY[objectID][Things.PORTRAIT] = tex diff --git a/Scenes/PickThingWindow.gd b/Scenes/PickThingWindow.gd index 7b43e7ed..a01704e8 100644 --- a/Scenes/PickThingWindow.gd +++ b/Scenes/PickThingWindow.gd @@ -143,17 +143,21 @@ func update_selection_position(): oSelectedRect.rect_global_position = oSelectedRect.boundToItem.rect_global_position oSelectedRect.rect_size = oSelectedRect.boundToItem.rect_size +enum { + CHANGE_TO_PORTRAIT, + CHANGE_TO_SPRITE, +} func _on_hovered_none(id): oCenteredLabel.get_node("Label").text = "" - change_portrait_on_hover(id, Things.PORTRAIT) + change_portrait_on_hover(id, CHANGE_TO_PORTRAIT) func _on_hovered_over_item(id): var offset = Vector2(id.rect_size.x * 0.5, id.rect_size.y * 0.5) oCenteredLabel.rect_global_position = id.rect_global_position + offset oCenteredLabel.get_node("Label").text = id.get_meta("grid_item_text") - change_portrait_on_hover(id, Things.SPRITE) + change_portrait_on_hover(id, CHANGE_TO_SPRITE) func change_portrait_on_hover(id, textureOrPortrait): @@ -161,8 +165,8 @@ func change_portrait_on_hover(id, textureOrPortrait): var subtype = id.get_meta("thingSubtype") var tex match textureOrPortrait: - Things.SPRITE: tex = Things.fetch_sprite(thingType, subtype) - Things.PORTRAIT: tex = Things.fetch_portrait(thingType, subtype) + CHANGE_TO_SPRITE: tex = Things.fetch_sprite(thingType, subtype) + CHANGE_TO_PORTRAIT: tex = Things.fetch_portrait(thingType, subtype) if tex != null: id.img_normal = tex diff --git a/project.godot b/project.godot index fc13a601..473f32de 100644 --- a/project.godot +++ b/project.godot @@ -71,6 +71,7 @@ Slabset="*res://Autoload/Slabset.gd" Columnset="*res://Autoload/Columnset.gd" Version="*res://Autoload/Version.gd" Graphics="*res://Autoload/Graphics.gd" +ObjectNames="*res://Autoload/ObjectNames.gd" [debug]