How can I make a change in the lua code and reload it without exiting the game?

Prior art:
 - https://forum.minetest.net/viewtopic.php?f=50&t=13317
 - maybe pull assets from that game? (bones / blood splats?)

TODO list
 - DONE optimze level loading... 
   - DONE use minetest method load generating a lot of blocks
     as part of that

   - DONE Generate the first 2 levels (see how long that takes)
   - DONE Then generate one level at a time (lazy)
     - DONE when get to level 2, generate level 4

 - DONE More items (I think these are doable and would make the game fun)
   - DONE scroll of shattering (breaks all stone with certain radius)
   - DONE potion of levetation 
   - DONE potion of incineration
   - DONE potion of decent
   - DONE potion of life

   - DONE potion of strength and scroll of enchantment are actuall hard because it requires rebalancing the game and adding new attributes 
     to the player.  I'll save this for last
     - DONE strength for player weapons is done
     - DONE strength for player armor is done

   - Mobs need to be smart
     - DONE scroll of teleportation - save for after Mob pathfinding is done - can use that to figureout how to teleport
       - can be done with the get random location function
     - DONE wand of teleportation
     - DONE wand of polymorph (that will be interesting)
     - DONE staff of poison
       - DONE still need a poison effect for players and mobs
     - staff of conjuration
     - staff of entrancement

   - Mob allies
     - wand of healing
     - DONE staff of protection (use with multiplayer :-))
     - wand of haste
     - wand of slowness
       - need a slowness effect on the mob

   - DONE staves and charms need rechard
     - DONE scroll of recharge

   - Need a gas system
     - DONE potion of caustic gas
       - DONE need to redo potion to use the effect - maybe redo potions to use grenades library...
     - potion of paralysis (could use this effect for when a monster seizes you as well)
     - potion of confusion (random curvy turn to movement)
       - how to apply to mobs?

   - DONE potion of fire immunity (swim through lava, no burning harm, no fire harm)
   - DONE potion of creeping death


   - DONE staff of firebolt
     - DONE test on fire the air it goes through
     - DONE higher levels of enchantment deal more damage
   - DONE Improve: staff of lightning
     - DONE goes in a straigt line through creatures until it hits stone or door
     - DONE higher levels of enchantment deal more damage
     - DONE needs rebalanced - probably needs cooldown per enemy so it doesn't cause damage every step
   - DONE staff of tunneling
     - DONE higher levels of enchantment will make the tunneling go further
     - don't have it injure mobs though - this is a bug...
   - DONE staff of obstruction
     - DONE higher levels of enchantment will make the obstruction bigger and 
     - last longer - didn't see that in the wiki
   - DONE staff of blinking 
     - DONE higher levels of enchantment will help you blink further

   - DONE charm of health
   - DONE charm of haste (like potion, but rechargable)
   - DONE charm of fire immunity
   - DONE charm of shattering
   - DONE charm of teleportation
   - DONE charm of recharing - only recharges staves
   - DONE charm of invisibility (save for after monster revamp)
     - DONE potion of invisibilty
     - DONE also ring of stealth
   - DONE charm of protection (shield that needs depleted before health)
   - charm of guardian (save for after monster revamp)
     - basically an ally


   - DONE Need poison effect to do staff of poison correctly
     - DONE applies to mobs when using a staff of poison
     - DONE applies mob or player in creeping death
     - DONE it stacks - if poisoned multiple times, then you get greater damage
     - DONE it stops regeneration
     - DONE potion of life cures it 
     - DONE applies to players when bit by spider 

   - Rings
     - DONE ring of regneration (health recharges faster)
     - DONE ring of transferance (get health when damage monster)
     - DONE ring of wisdom (wands, staves, and charms recharge faster)
     - DONE ring of reaping (wands, staves and charms recharge when hit monster)


  - DONE Don't forget the simple traps (fire, flood)
    - DONE fire
    - DONE flood
    - DONE descent
    - DONE net
    - DONE gas

Concepts for items
 - DONE Make it so you can win - grab a crystal and place on block
 - DONE things that recharge and their change limit (keep in mind enchantment will increate charge max)
 - DONE Monster behaviour updates

 - Update level generation to include machines!



TODOS list (for 1.0)
  - DONE armor update
    - DONE use armor from voxel dungeon (figure out how to have 1 slot)
    - DONE slow down if not strong enough
  - DONE item enchantment
    - do this now so when I implement rings and wands, I can do enchantment with them
    - DONE armor
    - DONE weapons
    - DONE charms
    - DONE staves
    - DONE rings
    - DONE wands
  - DONE rings
   - there's a rings mod I might be able to borrow some images and code from: 
   - https://github.com/MT-Goops/rings/
   - looks like it uses the armor mod
  - DONE wands
    - DONE polymorph
    - DONE teleportation
    - slowness (need temp mob effects)
    - plenty
  - add poison effect for mobs and players (like mcl_burning)
    - poisons can stake, but need a 1 second cool down
  - DONE mob effects when they hit
    - DONE acids degrade weapons and armor
    - DONE spiders poison
    - DONE monkeys steal
    - DONE bloats die and explode
  - DONE more scrolls
    - DONE protect weapon
    - DONE protect armor
  - DONE mobs
    - DONE regeneration
    - DONE hit accuracy 
  - monster behaviors (pretty close, could do path finding later)
    - DONE test and fix water monsters getting out of water (think I know why)
      - DONE attack for water and fly monsters require line of sight to target
      - DONE warn for land monsters require line of sight
    - brogue seperates 2 things for mobs
     - DONE monster behaviour
     - DONE monster ability
     - DONE also add monster accuracy
     - DONE player hits monster (acid degrades weapon, monster goes in hunt mode)
     - DONE things that happens to a monster when it hits you
       - DONE needs to be handled in that armor callback - will probably move that into it's own mod
    - if I only want monster running that are on the current level, I can get the monsters on the a level
    - then add capabilities to monsters
      - mob health should recharge over time like player health
      - go through the monster list in Brogue and figure out a way to represent flags on mogue mobs
      - examples: 
        - new - some monsters jump attack, others just "hit" without jump
        - DONE spiders shoot webs and their bites poison players and other monsters
        - DONE bloats explode when they get hit a player
        - bog monsters can sieze
        - DONE wraiths flee with low health
        - DONE centipedes weaken
        - DONE monkeys steal then flee
        - DONE wisp sets fire to flamable terrain 
        - dars blink away with low health then flee
          - blinking away is tricky, but blinking toward could be helpful
        - DONE acids degrade weapons and armor (after enchanting)
  - DONE add more info to HUD (strength, armor class, wielded item info)
  - DONE highscores
   - DONE fix the signs
   - DONE top 10 in order
   - DONE maybe add the date
  - DONE add more items (see above list)
  - path finding for monsters (for wandering and hunting)
  - DONE figure out lighting 
    - ring of light as well?
    - DONE light in brogue is around the player
    - DONE in this case would need to use light nodes
    - DONE replace them every second or 0.5 second
  - DONE maybe refactor items into their own files

I feel like with 1.0, a lot of the hard stuff will done and adding new content should be a lot easier

1.5
 - machines from Brogue
   - these are cool puzzles and weird dungeon functions
   - refactor dungeon tiles, dungeon feature code in seperate lists
   - fix auto generates to use dungeon tiles instead of dungeon features
   - figure out how to make them work...
 - move crystal down?
 - support lower dungeon levels
 - add more mobs from Brogue?
 - add lumen stones?

Mmogue, haha (multiplayer mogue)
 - fork the code to keep single player and multiplayer seperate
 - introduce features from mangband/tomenet/pwmangband to support longer term multiplayer
   - https://www.mangband.org/
   - https://github.com/draconisPW/PWMAngband
   - https://tangaria.com/
 - features:
   - 100 levels? How would I make them different?
   - loads more items? - like the randarts?
   - more monsters? - there's about 68 in Brogue, mutations could make more...
   - levels regenerate 
   - make it way way harder
   - village with shops
   - different entrances to different depths
   - buy land in overworld for houses, get wood and chests from shops or dungeons to build houses
 - run a server and get feedback

Other ideas
 - Make an open world RPG
 - Find open source open world roguelike and port to luanti
   - Shadow of the Wyrm
   - Omega


Little TODOS:
 - DONE When on fire and running through grass should set it on fire
 - DONE All mobs have hurt sound - get sounds from MCL
 - DONE Use blazes for wisp


Balance questions
 - DONE slow down hunger - per player regen rate depending on rings your wearing
 - DONE slow down regen (rings can speed it up then)
 - DONE miss for player weapon attacks?


DONE Run a server, have people play on that to get some feedback.
Review logs to get an idea of what people are doing
 - Add some more relevant logs to see what's going on
 - not enough people actually play on the server :-( 


Video Trailer Ides
 - Shot over the overworld
   - Some copy about being drawn to the dungeons of doom for treasure and prize crystal
 - Shot few "static" of dungeons 
   - show mobs wandering around
   - show chasms and briges
   - show lava
 - Action shots of playing
   - Shot of fighting mob
   - Shot of enchanting an item
   - Wand of fire catching the terrain on fire and mobs on fire
   - Shot of trigger descent trap
   - Shot of dying
   - Shot of trying again, going in dungeon 

 
Monster states
 - sleeping 
   - 75% chance to be sleeping if never sleeps
   - if a minion, then will spawn in the same state as leader
   - DONE if a minion or leader wakes, then the whole horde wakes and hunts you
 - wandering
   - minions will follow leader
   - if leader dies, then new leader is picked at random in the group
   - will pick a random location on the map and path find to it
   - once reach the destination, pick a new location on the map and path find to it
 - hunting
   - DONE if a monster is within the stealth range and line of sight of the player then the monster has a 25% chance to start hunting the player
   - DONE if you are triple the stealth range, then the monster has a chance to lose track of you
   - if you are in line of sight, the monster will go for you, if you are out of line of sight, the monster will use path finding to get to you
 - fleeing
   - if a monster is in a fleeing state, they will try to stay 2 times outside your stealth range
   - fleeing monsters will go in water to get away

 - sleep, wander, hunt, confused, discordant, entranced, flee
   - monster warning functions as a kind of sleep for right now
   - might be good to have both in there - slow things down to give you a choice before engaging a monster
   - monsters need line of sight for warning and to start hunting
   - allow some monsters to open doors (things that would have hands)
 - land monsters should avoid stepping on traps (annoying to have fire/flood/net) traps triggered when you get to a level
 - land monsters can go in shallow water, but not lava 
   - this is buggy
 - land monsters should avoid fire and creeping death (maybe a node group, mob avoid, mob avoid above)
 - flying monsters should avoid following a player in liquids



Here's the rest of items I need to finish for Mogue v0.9:

    DONE stealth (player velocity effecting stealth, armor effecting stealth, ring of stealth effecting stealth radius, and potion of invisibility).  Right now it's hard coded at 7),
    DONE acids degrading weapons and scroll of protect weapon (armor is done already),
    DONE Wisps lighting terrain on fire (switch to blaze)
    DONE monkeys stealing your stuff,
    DONE look into balancing enchanting weapons - war pike seems over powered when there's 6 enchantments in it 
      - forumla was wrong - did some testing with Brogue code to confirm - it's good now
    DONE sort highscores
    DONE mob health regeneration

    DONE mob hit accuracy
    DONE highscore signs not editable
    potion of telepathy
    negation effect??
      - I want to create an mg_object_effect system before implementing negation

Mogue v1
    DONE toads to cause a darkness effect
    DONE mobs can shoot
      - DONE Spiders shoot webs 
      - DONE Centar/pilligar shoot arrows
    DONE mob group behaviors
      DONE - hit one mob in group and wakes everyone else up to start hunting
    DONE mobs can summon other mobs 
      - DONE (like goblin conjurer)
    DONE mobs can cast spells:
      - DONE protection effect for mobs (goblin mystic)
      - TODO slowness on player
    more mobs
      - troll - fast regen, high health
      - illager (shooting arrows)
      - zombie (release gas when hit, and have gas eminate from him)
        - create nausiou effect - slow player randomly while nausous

    mob path finding (might have to swap out mob libraries to do this)

    weapon behavor update
      - axe to get wide area around player
      - whip to use a bolt that comes back to the player after it goes a certain distance
      - DONE javilin as more powerful arrows - steel arrows
      - DONE loose arrows if hit monster 40% chance to drop arrow if hit monster
      - DONE based on time to recover weapon will reduce accuracy of the weapon ? - use full_punch_internal
      - DONE introduce weapon missing based on accuracy - try to make it harder



    identification (right now everything is fully identified) - makes it hard to know if gear is good or not
      - start with these
        - weapons
          - might be able to do cursed weapons
        - armor (cursed armor) - the armor library supports this
        - rings (and cursed rings) - just don't know enchantment
        - wands - don't know charges
        - staves - don't know charges + enchantment
      - not do potions and scrolls - seems tricky

Immediate future stuff:
  - contentdb launch 
    - fix mob punching, 
    - fix level connection, 
    - no diggable nodes (or dont drop anything if you do dig them)
  - ring of light
  - mg_object_effect system refactor
  - weapon behavor update
    - axe to get wide area around player
    - whip to use a bolt that comes back to the player after it goes a certain distance
    - rapier to do a lunge attack like in brogue - only works if like 2.5 squares away from a mob though for like double damage
  - more mobs
    - troll - fast regen, high health
    - goblin totem
    - ogre totem
    - ogre shaman
    - dar priestess
    - dar battle mage
    - turrets!
      - arrow
      - firebolt
      - poison
    - pixie
  - more items
    - scroll of discord
    - wand of slowness
    - staff of healing
    - staff of haste
    - negation scroll
    - negation charm
    - negation wand
    - invisibility wand
      - player - update to invisible texture and set stealth range to 1
      - mob - update to invisible texture temp

  - re-work gas system (right now only support caustic gas - used from the grenades mod from CTF).  I'd like to add steam, nausous gas, paralyzing gas, confusion gas, blinding gas.  Gases to have density, bouncy, expansion.  Not go through walls 
  - rework mob combat and pathfinding
  - machines






Post 1.0
    paralysis effect - don't need this until py
    alarm trap

    grab Globals.c and Rogue.h from brogue and wire up a JSON C library and dump all the stuff in globals to JSON so mogue can read from it
    Update level generation to use the JSON dump




