Anatomy of A Thing - YeOldeDM/realms-of-todog GitHub Wiki

A Thing is an instance of something which exists within the dungeon. Anything that is not the dungeon floors and walls will be a Thing.

A Thing is made up of a root Thing Node, with optional Component Node children.

Thing: The root of all Things

  • _rpg_process mainloop
  • description text
  • cell position
  • SID SpawnID
  • blocks_movement, blocks_sight flags
  • found, in_inventory state
  • cell_changed signal
  • about_to_act acted signals

All components are made to be direct children of Thing.

Fighter: A Thing that can take/deal damage, and equip Gear

  • hp
  • current_hp
  • take_damage() heal_damage() function
  • attack() function

Item: A Thing which can be placed in the inventory and "used" for various effects

  • weight

Equipment: An Item Thing that can be equipped to a Gear slot

  • slot

FX: A visual effect that removes itself after some time