Lua API reference
Note
This page is auto-generated from data/raw/generate_docs.lua
and should not be edited directly.
Warning
In Lua, functions can be called with a : and pass the object itself as the first argument, eg:
Members where this behaviour is intended to be used are marked as 🇲 Methods
Their signature documentation hides the first argument to reflect that
- Call 🇫 Function members with a
. - Call 🇲 Method members with a
:
Alternatively, you can still call 🇲 Methods with a ., from the class type or the variable itself
but a value of the given type must be passed as the first parameter (that is hidden)
All of these do the same thing:
-
print(Angle.from_radians(3):to_degrees()) -
print(Angle.to_degrees(Angle.from_radians(3))) -
local a = Angle.from_radians(3) print(a:to_degrees()) -
local a = Angle.from_radians(3) print(a.to_degrees(a)) -
local a = Angle.from_radians(3) print(Angle.to_degrees(a))
ActivityTypeId
Bases
No base classes.
Constructors
- ActivityTypeId.new( )
- ActivityTypeId.new( ActivityTypeId )
- ActivityTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> ActivityTypeId
obj
🇲 Method --> ( ) -> ActivityTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
AmmunitionEffectId
Bases
No base classes.
Constructors
- AmmunitionEffectId.new( )
- AmmunitionEffectId.new( AmmunitionEffectId )
- AmmunitionEffectId.new( AmmunitionEffectIntId )
- AmmunitionEffectId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> AmmunitionEffectId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> AmmunitionEffectRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> AmmunitionEffectIntId
AmmunitionEffectIntId
Bases
No base classes.
Constructors
- AmmunitionEffectIntId.new( )
- AmmunitionEffectIntId.new( AmmunitionEffectIntId )
- AmmunitionEffectIntId.new( AmmunitionEffectId )
Members
obj
🇲 Method --> ( ) -> AmmunitionEffectRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> AmmunitionEffectId
AmmunitionTypeId
Bases
No base classes.
Constructors
- AmmunitionTypeId.new( )
- AmmunitionTypeId.new( AmmunitionTypeId )
- AmmunitionTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> AmmunitionTypeId
obj
🇲 Method --> ( ) -> AmmunitionTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
Angle
Bases
No base classes.
Constructors
No constructors.
Members
from_radians
🇫 Function --> ( number ) -> Angle
to_arcmin
🇲 Method --> ( ) -> number
to_degrees
🇲 Method --> ( ) -> number
from_arcmin
🇫 Function --> ( number ) -> Angle
from_degrees
🇫 Function --> ( number ) -> Angle
to_radians
🇲 Method --> ( ) -> number
ArmorPortionData
Bases
No base classes.
Constructors
No constructors.
Members
coverage
🇻 Variable --> integer
encumber
🇻 Variable --> integer
max_encumber
🇻 Variable --> integer
get_covered_parts
🇲 Method --> ( ) -> BodyPartTypeIntId[]
Avatar
Bases
PlayerCharacterCreature
Constructors
No constructors.
Members
get_active_missions
🇲 Method --> ( ) -> Mission[]
get_completed_missions
🇲 Method --> ( ) -> Mission[]
get_failed_missions
🇲 Method --> ( ) -> Mission[]
Bionic
Bases
No base classes.
Constructors
No constructors.
Members
incapacitated_time
🇻 Variable --> TimeDuration
energy_stored
🇻 Variable --> Energy
ammo_count
🇻 Variable --> integer
powered
🇻 Variable --> boolean
show_sprite
🇻 Variable --> boolean
invlet
🇻 Variable --> integer
charge_timer
🇻 Variable --> integer
set_auto_start_thresh
🇲 Method --> ( number )
get_auto_start_thresh
🇲 Method --> ( ) -> number
is_auto_start_on
🇲 Method --> ( ) -> boolean
id
🇲 Method --> ( ) -> BionicDataId
toggle_auto_start_mod
🇲 Method --> ( )
is_auto_start_keep_full
🇲 Method --> ( ) -> boolean
activate
🇲 Method --> ( Character, boolean? ) -> boolean
Activates this bionic on the given character. Optional block_message (default true) suppresses messages.
toggle_safe_fuel_mod
🇲 Method --> ( )
remove_flag
🇲 Method --> ( string )
get_quality
🇲 Method --> ( string ) -> integer
info
🇲 Method --> ( ) -> BionicDataRaw
Returns the BionicData definition for this bionic.
ammo_loaded
🇲 Method --> ( ) -> string
is_fueled_by
🇲 Method --> ( string ) -> boolean
set_flag
🇲 Method --> ( string )
has_flag
🇲 Method --> ( string ) -> boolean
deactivate
🇲 Method --> ( Character, boolean? ) -> boolean
Deactivates this bionic on the given character. Optional block_message (default true) suppresses messages.
BionicDataId
Bases
No base classes.
Constructors
- BionicDataId.new( )
- BionicDataId.new( BionicDataId )
- BionicDataId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> BionicDataId
obj
🇲 Method --> ( ) -> BionicDataRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
BionicDataRaw
Bases
No base classes.
Constructors
No constructors.
Members
exothermic_power_gen
🇻 Variable --> boolean
starting_bionic
🇻 Variable --> boolean
fuel_capacity
🇻 Variable --> integer
remote_fuel_draw
🇻 Variable --> Energy
points
🇻 Variable --> integer
weight_capacity_bonus
🇻 Variable --> Mass
fuel_efficiency
🇻 Variable --> number
passive_fuel_efficiency
🇻 Variable --> number
fuel_multiplier
🇻 Variable --> integer
can_uninstall
🇻 Variable --> boolean
no_uninstall_reason
🇻 Variable --> string
weight_capacity_modifier
🇻 Variable --> number
is_remote_fueled
🇻 Variable --> boolean
activated
🇻 Variable --> boolean
power_deactivate
🇻 Variable --> Energy
power_activate
🇻 Variable --> Energy
included
🇻 Variable --> boolean
power_trigger
🇻 Variable --> Energy
power_over_time
🇻 Variable --> Energy
capacity
🇻 Variable --> Energy
charge_time
🇻 Variable --> integer
kcal_trigger
🇻 Variable --> integer
learned_spells
🇲 Method --> ( ) -> table<string, integer>
Spells learned when this bionic is installed, mapped to level.
included_bionics
🇲 Method --> ( ) -> string[]
Bionics automatically installed alongside this one.
enchantments
🇲 Method --> ( ) -> string[]
Returns enchantment IDs as string values.
upgraded_bionic
🇲 Method --> ( ) -> string
flags
🇲 Method --> ( ) -> string[]
Returns the set of flag IDs on this bionic definition.
required_bionics
🇲 Method --> ( ) -> string[]
Other bionics required for this one to be installed.
available_upgrades
🇲 Method --> ( ) -> string[]
Available upgrade paths for this bionic.
canceled_mutations
🇲 Method --> ( ) -> string[]
Mutations/traits removed when this bionic is installed.
has_flag
🇲 Method --> ( string ) -> boolean
Checks whether this bionic has a specific flag.
fake_item
🇲 Method --> ( ) -> string
id
🇲 Method --> ( ) -> BionicDataId
occupied_bodyparts
🇲 Method --> ( ) -> table<string, integer>
Body parts occupied by this bionic and slot space required.
fuel_opts
🇲 Method --> ( ) -> string[]
Returns fuel type IDs that can power this bionic.
coverage_power_gen_penalty
🇲 Method --> ( ) -> number?
Returns the coverage power gen penalty, or nil if not set.
stat_bonus
🇲 Method --> ( ) -> table<string, integer>
Returns stat bonuses as a table mapping stat name to bonus value.
name
🇲 Method --> ( ) -> string
Returns the translated name of this bionic.
description
🇲 Method --> ( ) -> string
Returns the translated description of this bionic.
encumbrance
🇲 Method --> ( ) -> table<string, integer>
Encumbrance caused by this bionic on each body part.
get_all
🇫 Function --> ( ) -> BionicDataRaw[]
Returns a list of every bionic definition in the game.
env_protec
🇲 Method --> ( ) -> table<string, integer>
Environmental protection by body part.
bullet_protec
🇲 Method --> ( ) -> table<string, integer>
Bullet protection by body part.
power_gen_emission
🇲 Method --> ( ) -> string
cut_protec
🇲 Method --> ( ) -> table<string, integer>
Cut protection by body part.
bash_protec
🇲 Method --> ( ) -> table<string, integer>
Bash protection by body part.
BodyPartTypeId
Bases
No base classes.
Constructors
- BodyPartTypeId.new( )
- BodyPartTypeId.new( BodyPartTypeId )
- BodyPartTypeId.new( BodyPartTypeIntId )
- BodyPartTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> BodyPartTypeId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> BodyPartTypeRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> BodyPartTypeIntId
BodyPartTypeIntId
Bases
No base classes.
Constructors
- BodyPartTypeIntId.new( )
- BodyPartTypeIntId.new( BodyPartTypeIntId )
- BodyPartTypeIntId.new( BodyPartTypeId )
Members
obj
🇲 Method --> ( ) -> BodyPartTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> BodyPartTypeId
BookRecipe
Bases
No base classes.
Constructors
No constructors.
Members
name
🇻 Variable --> CppVal<translation>
recipe
🇻 Variable --> RecipeRaw
skill_level
🇻 Variable --> integer
hidden
🇻 Variable --> boolean
Character
Bases
Creature
Constructors
No constructors.
Members
name
🇻 Variable --> string
mutation_category_level
🇻 Variable --> table<MutationCategoryTraitId, integer>
cash
🇻 Variable --> integer
follower_ids
🇻 Variable --> CharacterId[]
focus_pool
🇻 Variable --> integer
male
🇻 Variable --> boolean
get_base_traits
🇲 Method --> ( ) -> MutationBranchId[]
mutation_value
🇲 Method --> ( string ) -> number
get_mutations
🇲 Method --> ( boolean ) -> MutationBranchId[]
crossed_threshold
🇲 Method --> ( ) -> boolean
clear_mutations
🇲 Method --> ( )
clear_skills
🇲 Method --> ( )
healing_rate_medicine
🇲 Method --> ( number, BodyPartTypeIntId ) -> number
healing_rate
🇲 Method --> ( number ) -> number
is_throw_immune
🇲 Method --> ( ) -> boolean
add_addiction
🇲 Method --> ( AddictionType, integer )
practice
🇲 Method --> ( SkillId, integer, integer, boolean )
rust_rate
🇲 Method --> ( ) -> integer
rest_quality
🇲 Method --> ( ) -> number
read_speed
🇲 Method --> ( boolean ) -> integer
is_rad_immune
🇲 Method --> ( ) -> boolean
get_time_died
🇲 Method --> ( ) -> TimePoint
rem_addiction
🇲 Method --> ( AddictionType )
addiction_level
🇲 Method --> ( AddictionType ) -> integer
mod_skill_level
🇲 Method --> ( SkillId, integer )
items_with
🇲 Method --> ( bool ) -> Item[]
Filters items
all_items
🇲 Method --> ( boolean ) -> Item[]
Gets all items
remove_item
🇲 Method --> ( Item ) -> Detached<Item>
Removes given
<code>[Item](#sol::Item)</code>from character's inventory. The<code>[Item](#sol::Item)</code>must be in the inventory, neither wielded nor worn.
takeoff
🇲 Method --> ( Item ) -> boolean
Attempts to take off the worn
<code>[Item](#sol::Item)</code>from character.
can_takeoff
🇲 Method --> ( Item ) -> boolean
Checks if a given
<code>[Item](#sol::Item)</code>can be taken off.
has_addiction
🇲 Method --> ( AddictionType ) -> boolean
all_items_with_flag
🇲 Method --> ( JsonFlagId, boolean ) -> Item[]
Gets all items with the given flag
get_item_with_id
🇲 Method --> ( ItypeId, boolean ) -> Item
Gets the first occurrence of an item with the given id
add_item
🇲 Method --> ( Detached<Item> )
Adds a detached item to the player inventory
is_hauling
🇲 Method --> ( ) -> boolean
has_item_with_flag
🇲 Method --> ( JsonFlagId, boolean ) -> boolean
Checks for an item with the given flag
create_item
🇲 Method --> ( ItypeId, integer ) -> Item
Creates and an item with the given id and amount to the player inventory
has_item_with_id
🇲 Method --> ( ItypeId, boolean ) -> boolean
Checks for an item with the given id
set_skill_level
🇲 Method --> ( SkillId, integer )
get_all_skills
🇲 Method --> ( ) -> SkillLevelMap
remove_worn
🇲 Method --> ( Item ) -> Detached<Item>?
Attempts to remove the worn
<code>[Item](#sol::Item)</code>from character.
has_power
🇲 Method --> ( ) -> boolean
is_max_power
🇲 Method --> ( ) -> boolean
set_max_power_level
🇲 Method --> ( Energy )
has_max_power
🇲 Method --> ( ) -> boolean
is_worn
🇲 Method --> ( Item ) -> boolean
enough_power_for
🇲 Method --> ( BionicDataId ) -> boolean
weight_carried
🇲 Method --> ( ) -> Mass
set_power_level
🇲 Method --> ( Energy )
mod_power_level
🇲 Method --> ( Energy )
is_auto_start_on
🇲 Method --> ( BionicDataId ) -> boolean
get_auto_start_thresh
🇲 Method --> ( BionicDataId ) -> number
mod_max_power_level
🇲 Method --> ( Energy )
is_auto_start_keep_full
🇲 Method --> ( BionicDataId ) -> boolean
get_max_power_level
🇲 Method --> ( ) -> Energy
get_power_level
🇲 Method --> ( ) -> Energy
get_skill_level_object
🇲 Method --> ( SkillId ) -> SkillLevel
volume_carried
🇲 Method --> ( ) -> Volume
can_pick_volume
🇲 Method --> ( Volume ) -> boolean
worn_with_id
🇲 Method --> ( ItypeId, BodyPartTypeIntId ) -> boolean
worn_with_flag
🇲 Method --> ( JsonFlagId, BodyPartTypeIntId ) -> boolean
is_wearing_on_bp
🇲 Method --> ( ItypeId, BodyPartTypeIntId ) -> boolean
item_worn_with_flag
🇲 Method --> ( JsonFlagId, BodyPartTypeIntId ) -> Item
get_skill_level
🇲 Method --> ( SkillId ) -> integer
item_worn_with_id
🇲 Method --> ( ItypeId, BodyPartTypeIntId ) -> Item
volume_capacity
🇲 Method --> ( ) -> Volume
is_wearing
🇲 Method --> ( Item ) -> boolean
unwield
🇲 Method --> ( ) -> boolean
is_armed
🇲 Method --> ( ) -> boolean
can_pick_weight
🇲 Method --> ( Mass, boolean ) -> boolean
is_wielding
🇲 Method --> ( Item ) -> boolean
can_wield
🇲 Method --> ( Item ) -> boolean
can_unwield
🇲 Method --> ( Item ) -> boolean
wield
🇲 Method --> ( Item ) -> boolean
get_dependant_worn_items
🇲 Method --> ( Item ) -> Item[]
can_wear
🇲 Method --> ( Item, boolean ) -> boolean
Checks if creature can wear a given item. If boolean parameter is true, ignores already worn items
wear
🇲 Method --> ( Item, boolean ) -> boolean
Attempts to wear an item in the creature inventory. If boolean parameter is false, item is worn instantly
has_morale
🇲 Method --> ( MoraleTypeDataId ) -> boolean
add_morale
🇲 Method --> ( MoraleTypeDataId, integer, integer, TimeDuration, TimeDuration, boolean, ItypeRaw )
get_morale_level
🇲 Method --> ( ) -> integer
get_morale
🇲 Method --> ( MoraleTypeDataId ) -> integer
clear_morale
🇲 Method --> ( )
rem_morale
🇲 Method --> ( MoraleTypeDataId )
has_morale_to_read
🇲 Method --> ( ) -> boolean
has_morale_to_craft
🇲 Method --> ( ) -> boolean
is_wearing_helmet
🇲 Method --> ( ) -> boolean
get_visible_creatures
🇲 Method --> ( integer ) -> Creature[]
blossoms
🇲 Method --> ( )
spores
🇲 Method --> ( )
wearing_something_on
🇲 Method --> ( BodyPartTypeIntId ) -> boolean
rooted
🇲 Method --> ( )
get_hostile_creatures
🇲 Method --> ( integer ) -> Creature[]
fall_asleep
🇲 Method --> ( )
🇲 Method --> ( TimeDuration )
get_painkiller
🇲 Method --> ( ) -> integer
knows_recipe
🇲 Method --> ( RecipeId ) -> boolean
suffer
🇲 Method --> ( )
use_charges
🇲 Method --> ( ItypeId, integer, bool ) -> Detached<Item>[]
bodypart_exposure
🇲 Method --> ( ) -> table<BodyPartTypeIntId, number>
drop_all_items
🇲 Method --> ( )
Drops all items (inventory, worn, wielded) at the character's current position.
use_charges_if_avail
🇲 Method --> ( ItypeId, integer ) -> boolean
invalidate_crafting_inventory
🇲 Method --> ( )
Invalidates the cached crafting inventory
crafting_inventory
🇲 Method --> ( ) -> Inventory
Returns the crafting inventory for this character (includes nearby items)
learn_recipe
🇲 Method --> ( RecipeId )
drop_inv
🇲 Method --> ( integer )
hearing_ability
🇲 Method --> ( ) -> number
knows_trap
🇲 Method --> ( Tripoint ) -> boolean
Whether the character knows about the trap at the given tripoint.
irradiate
🇲 Method --> ( number, boolean ) -> boolean
get_lowest_hp
🇲 Method --> ( ) -> integer
add_known_trap
🇲 Method --> ( Tripoint, TrapRaw )
Characterlearns that the given trap is on the given tripoint. If the trap is null, the character learns that there is no trap there.
can_hear
🇲 Method --> ( Tripoint, integer ) -> boolean
add_known_trap
🇲 Method --> ( Tripoint, TrapIntId )
wear_detached
🇲 Method --> ( Detached<Item>, boolean ) -> boolean
Attempts to wear an item not in the creature inventory. If boolean parameter is false, item is worn instantly
set_painkiller
🇲 Method --> ( integer )
restore_scent
🇲 Method --> ( )
base_height
🇲 Method --> ( ) -> integer
age
🇲 Method --> ( ) -> integer
mod_base_age
🇲 Method --> ( integer )
set_base_height
🇲 Method --> ( integer )
height
🇲 Method --> ( ) -> integer
mod_base_height
🇲 Method --> ( integer )
bodyweight
🇲 Method --> ( ) -> Mass
set_base_age
🇲 Method --> ( integer )
metabolic_rate
🇲 Method --> ( ) -> number
get_worn_items
🇲 Method --> ( ) -> Item[]
set_auto_start_thresh
🇲 Method --> ( BionicDataId, number )
base_age
🇲 Method --> ( ) -> integer
assign_activity
🇲 Method --> ( ActivityTypeId, integer, integer, integer, string )
cancel_activity
🇲 Method --> ( )
has_activity
🇲 Method --> ( ActivityTypeId ) -> boolean
mod_painkiller
🇲 Method --> ( integer )
bionics_weight
🇲 Method --> ( ) -> Mass
get_stim
🇲 Method --> ( ) -> integer
wake_up
🇲 Method --> ( )
sound_hallu
🇲 Method --> ( )
mod_stamina
🇲 Method --> ( integer )
get_shout_volume
🇲 Method --> ( ) -> integer
vomit
🇲 Method --> ( )
shout
🇲 Method --> ( string, boolean )
get_armor_acid
🇲 Method --> ( BodyPartTypeIntId ) -> integer
set_stamina
🇲 Method --> ( integer )
get_stamina
🇲 Method --> ( ) -> integer
mod_stim
🇲 Method --> ( integer )
set_stim
🇲 Method --> ( integer )
get_stamina_max
🇲 Method --> ( ) -> integer
get_rad
🇲 Method --> ( ) -> integer
mod_rad
🇲 Method --> ( integer )
set_rad
🇲 Method --> ( integer )
toggle_auto_start_mod
🇲 Method --> ( BionicDataId )
add_bionic
🇲 Method --> ( BionicDataId )
consume_items
🇲 Method --> ( CppVal<item_comp>[] )
Consumes items from inventory based on item component list
set_sleep_deprivation
🇲 Method --> ( integer )
set_fatigue
🇲 Method --> ( integer )
set_thirst
🇲 Method --> ( integer )
get_faction_id
🇲 Method --> ( ) -> FactionId
sight_impaired
🇲 Method --> ( ) -> boolean
set_faction_id
🇲 Method --> ( FactionId )
has_alarm_clock
🇲 Method --> ( ) -> boolean
has_watch
🇲 Method --> ( ) -> boolean
set_stored_kcal
🇲 Method --> ( integer )
mod_fatigue
🇲 Method --> ( integer )
get_fatigue
🇲 Method --> ( ) -> integer
get_thirst
🇲 Method --> ( ) -> integer
mod_sleep_deprivation
🇲 Method --> ( integer )
get_sleep_deprivation
🇲 Method --> ( ) -> integer
mod_thirst
🇲 Method --> ( integer )
mod_stored_kcal
🇲 Method --> ( integer )
get_kcal_percent
🇲 Method --> ( ) -> number
get_part_temp_btu
🇲 Method --> ( BodyPartTypeIntId ) -> integer
Gets the current temperature of a specific body part (in Body Temperature Units).
get_temp_btu
🇲 Method --> ( ) -> table<BodyPartTypeIntId, integer>
Gets all bodyparts and their associated temperatures (in Body Temperature Units).
set_movement_mode
🇲 Method --> ( CharacterMoveMode )
get_movement_mode
🇲 Method --> ( ) -> CharacterMoveMode
is_invisible
🇲 Method --> ( ) -> boolean
expose_to_disease
🇲 Method --> ( DiseaseTypeId )
is_stealthy
🇲 Method --> ( ) -> boolean
is_quiet
🇲 Method --> ( ) -> boolean
set_part_temp_btu
🇲 Method --> ( BodyPartTypeIntId, integer )
Sets a specific body part to a given temperature (in Body Temperature Units).
is_blind
🇲 Method --> ( ) -> boolean
is_wearing_active_optcloak
🇲 Method --> ( ) -> boolean
blood_loss
🇲 Method --> ( BodyPartTypeIntId ) -> integer
set_temp_btu
🇲 Method --> ( integer )
Sets ALL body parts on a creature to the given temperature (in Body Temperature Units).
in_climate_control
🇲 Method --> ( ) -> boolean
get_part_encumbrance
🇲 Method --> ( BodyPartTypeId ) -> integer
is_wearing_active_power_armor
🇲 Method --> ( ) -> boolean
is_wearing_power_armor
🇲 Method --> ( boolean ) -> boolean
uncanny_dodge
🇲 Method --> ( ) -> boolean
max_stored_kcal
🇲 Method --> ( ) -> integer
set_healthy_mod
🇲 Method --> ( number )
get_dex_base
🇲 Method --> ( ) -> integer
get_str_base
🇲 Method --> ( ) -> integer
get_int
🇲 Method --> ( ) -> integer
get_per_base
🇲 Method --> ( ) -> integer
get_str_bonus
🇲 Method --> ( ) -> integer
get_int_base
🇲 Method --> ( ) -> integer
get_dex_bonus
🇲 Method --> ( ) -> integer
get_per
🇲 Method --> ( ) -> integer
get_str
🇲 Method --> ( ) -> integer
getID
🇲 Method --> ( ) -> CharacterId
get_magic
🇲 Method --> ( ) -> KnownMagic
Access the character's spellbook and mana pool.
get_dex
🇲 Method --> ( ) -> integer
setID
🇲 Method --> ( CharacterId, boolean )
reset_encumbrance
🇲 Method --> ( )
reset
🇲 Method --> ( )
get_stored_kcal
🇲 Method --> ( ) -> integer
get_per_bonus
🇲 Method --> ( ) -> integer
set_str_bonus
🇲 Method --> ( integer )
get_healthy_mod
🇲 Method --> ( ) -> number
get_healthy
🇲 Method --> ( ) -> number
set_speed_bonus
🇲 Method --> ( integer )
mod_healthy
🇲 Method --> ( number )
set_healthy
🇲 Method --> ( number )
mod_healthy_mod
🇲 Method --> ( number, number )
get_int_bonus
🇲 Method --> ( ) -> integer
mod_speed_bonus
🇲 Method --> ( integer )
mod_per_bonus
🇲 Method --> ( integer )
set_per_bonus
🇲 Method --> ( integer )
set_dex_bonus
🇲 Method --> ( integer )
mod_int_bonus
🇲 Method --> ( integer )
set_int_bonus
🇲 Method --> ( integer )
mod_dex_bonus
🇲 Method --> ( integer )
mod_str_bonus
🇲 Method --> ( integer )
toggle_safe_fuel_mod
🇲 Method --> ( BionicDataId )
get_melee_stamina_cost
🇲 Method --> ( Item ) -> integer
bionic_armor_bonus
🇲 Method --> ( BodyPartTypeIntId, DamageType ) -> number
mutate_towards
🇲 Method --> ( MutationBranchId[], integer ) -> boolean
mutate_category
🇲 Method --> ( MutationCategoryTraitId )
mutation_ok
🇲 Method --> ( MutationBranchId, boolean, boolean ) -> boolean
mutate_towards
🇲 Method --> ( MutationBranchId ) -> boolean
remove_mutation
🇲 Method --> ( MutationBranchId, boolean )
mutate_towards
🇲 Method --> ( MutationBranchId[], integer ) -> boolean
🇲 Method --> ( MutationBranchId ) -> boolean
has_child_flag
🇲 Method --> ( MutationBranchId ) -> boolean
mutate
🇲 Method --> ( )
deactivate_mutation_id
🇲 Method --> ( MutationBranchId )
mabuff_attack_cost_mult
🇲 Method --> ( ) -> number
mabuff_attack_cost_penalty
🇲 Method --> ( ) -> integer
has_active_mutation
🇲 Method --> ( MutationBranchId ) -> boolean
mutation_effect
🇲 Method --> ( MutationBranchId )
activate_mutation_id
🇲 Method --> ( MutationBranchId )
mutation_loss_effect
🇲 Method --> ( MutationBranchId )
mabuff_damage_bonus
🇲 Method --> ( DamageType ) -> integer
remove_child_flag
🇲 Method --> ( MutationBranchId )
is_weak_to_water
🇲 Method --> ( ) -> boolean
get_used_bionics_slots
🇲 Method --> ( BodyPartTypeIntId ) -> integer
clear_bionics
🇲 Method --> ( )
has_bionics
🇲 Method --> ( ) -> boolean
get_total_bionics_slots
🇲 Method --> ( BodyPartTypeIntId ) -> integer
remove_bionic
🇲 Method --> ( BionicDataId )
get_free_bionics_slots
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_highest_category
🇲 Method --> ( ) -> MutationCategoryTraitId
has_any_bionic
🇲 Method --> ( ) -> boolean
deactivate_bionic
🇲 Method --> ( BionicDataId, boolean? ) -> boolean
get_bionics
🇲 Method --> ( ) -> BionicDataId[]
mutation_armor
🇲 Method --> ( BodyPartTypeIntId, DamageType ) -> number
has_active_bionic
🇲 Method --> ( BionicDataId ) -> boolean
get_bionic
🇲 Method --> ( BionicDataId ) -> Bionic
activate_bionic
🇲 Method --> ( BionicDataId, boolean? ) -> boolean
has_bionic
🇲 Method --> ( BionicDataId ) -> boolean
cough
🇲 Method --> ( boolean, integer )
mabuff_damage_mult
🇲 Method --> ( DamageType ) -> number
mabuff_speed_bonus
🇲 Method --> ( ) -> integer
is_mounted
🇲 Method --> ( ) -> boolean
mount_creature
🇲 Method --> ( Monster )
can_mount
🇲 Method --> ( Monster ) -> boolean
check_mount_will_move
🇲 Method --> ( Tripoint ) -> boolean
dismount
🇲 Method --> ( )
check_mount_is_spooked
🇲 Method --> ( ) -> boolean
forced_dismount
🇲 Method --> ( )
deactivate_mutation
🇲 Method --> ( MutationBranchId )
unset_mutation
🇲 Method --> ( MutationBranchId )
has_base_trait
🇲 Method --> ( MutationBranchId ) -> boolean
mabuff_armor_bonus
🇲 Method --> ( DamageType ) -> integer
activate_mutation
🇲 Method --> ( MutationBranchId )
has_trait_flag
🇲 Method --> ( JsonTraitFlagId ) -> boolean
set_mutation
🇲 Method --> ( MutationBranchId )
has_opposite_trait
🇲 Method --> ( MutationBranchId ) -> boolean
mabuff_arpen_bonus
🇲 Method --> ( DamageType ) -> integer
is_deaf
🇲 Method --> ( ) -> boolean
get_working_arm_count
🇲 Method --> ( ) -> integer
has_mabuff
🇲 Method --> ( MartialArtsBuffId ) -> boolean
global_sm_location
🇲 Method --> ( ) -> Tripoint
global_square_location
🇲 Method --> ( ) -> Tripoint
mabuff_tohit_bonus
🇲 Method --> ( ) -> number
mabuff_block_bonus
🇲 Method --> ( ) -> integer
mabuff_dodge_bonus
🇲 Method --> ( ) -> number
has_two_arms
🇲 Method --> ( ) -> boolean
healall
🇲 Method --> ( integer )
hitall
🇲 Method --> ( integer, integer, Creature ) -> integer
is_limb_disabled
🇲 Method --> ( BodyPartTypeIntId ) -> boolean
get_working_leg_count
🇲 Method --> ( ) -> integer
heal
🇲 Method --> ( BodyPartTypeIntId, integer )
is_limb_broken
🇲 Method --> ( BodyPartTypeIntId ) -> boolean
hurtall
🇲 Method --> ( integer, Creature, boolean )
can_run
🇲 Method --> ( ) -> boolean
consume_tools
🇲 Method --> ( CppVal<tool_comp>[] )
Consumes tool charges from inventory based on tool component list
CharacterId
Bases
No base classes.
Constructors
- CharacterId.new( )
- CharacterId.new( int )
Members
is_valid
🇲 Method --> ( ) -> boolean
get_value
🇲 Method --> ( ) -> integer
Creature
Bases
No base classes.
Constructors
No constructors.
Members
get_name
🇲 Method --> ( ) -> string
get_armor_cut_bonus
🇲 Method --> ( ) -> integer
get_armor_bullet_bonus
🇲 Method --> ( ) -> integer
get_armor_bash_bonus
🇲 Method --> ( ) -> integer
get_armor_bullet_base
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_armor_cut_base
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_armor_type
🇲 Method --> ( DamageType, BodyPartTypeIntId ) -> integer
get_melee
🇲 Method --> ( ) -> number
get_size
🇲 Method --> ( ) -> MonsterSize
get_dodge
🇲 Method --> ( ) -> number
get_speed
🇲 Method --> ( ) -> integer
get_hit
🇲 Method --> ( ) -> number
get_hp
🇲 Method --> ( BodyPartTypeIntId? ) -> integer
get_armor_bash_base
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_armor_cut
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_moves
🇲 Method --> ( ) -> integer
mod_moves
🇲 Method --> ( integer )
get_perceived_pain
🇲 Method --> ( ) -> integer
get_pain
🇲 Method --> ( ) -> integer
get_armor_bullet
🇲 Method --> ( BodyPartTypeIntId ) -> integer
set_moves
🇲 Method --> ( integer )
get_num_dodges
🇲 Method --> ( ) -> integer
get_num_blocks
🇲 Method --> ( ) -> integer
get_armor_bash
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_env_resist
🇲 Method --> ( BodyPartTypeIntId ) -> integer
set_pain
🇲 Method --> ( integer )
get_hp_max
🇲 Method --> ( BodyPartTypeIntId? ) -> integer
has_flag
🇲 Method --> ( MonsterFlag ) -> boolean
get_speed_base
🇲 Method --> ( ) -> integer
get_speed_bonus
🇲 Method --> ( ) -> integer
set_armor_bullet_bonus
🇲 Method --> ( integer )
set_armor_cut_bonus
🇲 Method --> ( integer )
set_armor_bash_bonus
🇲 Method --> ( integer )
get_speed_mult
🇲 Method --> ( ) -> number
get_dodge_base
🇲 Method --> ( ) -> number
get_hit_bonus
🇲 Method --> ( ) -> number
get_block_bonus
🇲 Method --> ( ) -> integer
get_dodge_bonus
🇲 Method --> ( ) -> number
get_hit_base
🇲 Method --> ( ) -> number
hp_percentage
🇲 Method --> ( ) -> integer
get_all_body_parts
🇲 Method --> ( boolean ) -> BodyPartTypeIntId[]
set_all_parts_hp_to_max
🇲 Method --> ( )
get_part_healed_total
🇲 Method --> ( BodyPartTypeIntId ) -> integer
set_part_hp_cur
🇲 Method --> ( BodyPartTypeIntId, integer )
get_part_hp_max
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_part_hp_cur
🇲 Method --> ( BodyPartTypeIntId ) -> integer
get_random_body_part
🇲 Method --> ( boolean ) -> BodyPartTypeIntId
set_part_hp_max
🇲 Method --> ( BodyPartTypeIntId, integer )
mod_part_hp_max
🇲 Method --> ( BodyPartTypeIntId, integer )
mod_part_hp_cur
🇲 Method --> ( BodyPartTypeIntId, integer )
mod_all_parts_hp_cur
🇲 Method --> ( integer )
set_all_parts_hp_cur
🇲 Method --> ( integer )
has_grab_break_tec
🇲 Method --> ( ) -> boolean
mod_pain_noresist
🇲 Method --> ( integer )
has_trait
🇲 Method --> ( MutationBranchId ) -> boolean
power_rating
🇲 Method --> ( ) -> number
speed_rating
🇲 Method --> ( ) -> number
sight_range
🇲 Method --> ( integer ) -> integer
sees
🇲 Method --> ( Creature ) -> boolean
🇲 Method --> ( Tripoint ) -> boolean
attitude_to
🇲 Method --> ( Creature ) -> Attitude
ranged_target_size
🇲 Method --> ( ) -> number
deal_damage
🇲 Method --> ( Creature, BodyPartTypeIntId, DamageInstance ) -> DealtDamageInstance
digging
🇲 Method --> ( ) -> boolean
knock_back_to
🇲 Method --> ( Tripoint )
size_melee_penalty
🇲 Method --> ( ) -> integer
apply_damage
🇲 Method --> ( Creature, BodyPartTypeIntId, integer, boolean )
is_on_ground
🇲 Method --> ( ) -> boolean
stability_roll
🇲 Method --> ( ) -> number
as_avatar
🇲 Method --> ( ) -> Avatar
get_grammatical_genders
🇲 Method --> ( ) -> string[]
is_avatar
🇲 Method --> ( ) -> boolean
skin_name
🇲 Method --> ( ) -> string
disp_name
🇲 Method --> ( possessive: boolean, capitalize_first: boolean ) -> string
dodge_roll
🇲 Method --> ( ) -> number
is_npc
🇲 Method --> ( ) -> boolean
as_monster
🇲 Method --> ( ) -> Monster
is_monster
🇲 Method --> ( ) -> boolean
as_character
🇲 Method --> ( ) -> Character
as_npc
🇲 Method --> ( ) -> Npc
mod_pain
🇲 Method --> ( integer )
is_underwater
🇲 Method --> ( ) -> boolean
is_warm
🇲 Method --> ( ) -> boolean
remove_effect
🇲 Method --> ( EffectTypeId, BodyPartTypeId? ) -> boolean
clear_effects
🇲 Method --> ( )
add_effect
🇲 Method --> ( EffectTypeId, TimeDuration, BodyPartTypeId?, integer? )
Effecttype, duration, bodypart and intensity
get_effect_int
🇲 Method --> ( EffectTypeId, BodyPartTypeId? ) -> integer
get_effect_dur
🇲 Method --> ( EffectTypeId, BodyPartTypeId? ) -> TimeDuration
set_value
🇲 Method --> ( string, string )
Sets an arbitrary key : value pair for the creature.NPC dialogue system uses this, with the format("npctalk_var" + "" + type_var + "" + var_context + "_" + var_base_name) used for the key, skipping type or context if empty.
get_value
🇲 Method --> ( string ) -> string
Retrieves an arbitrary entry using the same key format as set_value.
get_weight
🇲 Method --> ( ) -> Mass
remove_value
🇲 Method --> ( string )
Removes an arbitrary entry using the same key format as set_value.
erase
🇲 Method --> ( )
Removes this creature from the game without death notifications or a corpse.
values_table
🇫 Function --> ( Creature ) -> table
Returns all stored creature vars as a Lua table
set_underwater
🇲 Method --> ( boolean )
has_effect_with_flag
🇲 Method --> ( JsonFlagId, BodyPartTypeId? ) -> boolean
has_effect
🇲 Method --> ( EffectTypeId, BodyPartTypeId? ) -> boolean
is_hallucination
🇲 Method --> ( ) -> boolean
is_dead
🇲 Method --> ( ) -> boolean
has_weapon
🇲 Method --> ( ) -> boolean
in_species
🇲 Method --> ( SpeciesTypeId ) -> boolean
get_effect
🇲 Method --> ( EffectTypeId, BodyPartTypeId? ) -> Effect
is_elec_immune
🇲 Method --> ( ) -> boolean
is_immune_damage
🇲 Method --> ( DamageType ) -> boolean
is_immune_effect
🇲 Method --> ( EffectTypeId ) -> boolean
set_pos_ms
🇲 Method --> ( Tripoint )
get_pos_ms
🇲 Method --> ( ) -> Tripoint
get_weight_capacity
🇲 Method --> ( ) -> integer
DamageInstance
Represents a bunch of damage amounts
Constructors are:
new(damageType, amount, armorPen, remainingArmorMultiplier, damageMultiplier)
Bases
No base classes.
Constructors
- DamageInstance.new( )
- DamageInstance.new( DamageType, double, double, double, double )
Members
damage_units
🇻 Variable --> DamageUnit[]
empty
🇲 Method --> ( ) -> boolean
add_damage
🇲 Method --> ( DamageType, number, number, number, number )
add
🇲 Method --> ( DamageUnit )
clear
🇲 Method --> ( )
type_damage
🇲 Method --> ( DamageType ) -> number
total_damage
🇲 Method --> ( ) -> number
mult_damage
🇲 Method --> ( number, boolean )
DamageUnit
Represents a damage amount
Constructors are:
new()
new(damageType, amount, armorPen, remainingArmorMultiplier, damageMultiplier)
Bases
No base classes.
Constructors
- DamageUnit.new( DamageType, double, double, double, double )
Members
type
🇻 Variable --> DamageType
res_mult
🇻 Variable --> number
damage_multiplier
🇻 Variable --> number
res_pen
🇻 Variable --> number
amount
🇻 Variable --> number
DealtDamageInstance
Represents the final dealt damage
Bases
No base classes.
Constructors
No constructors.
Members
dealt_dams
🇻 Variable --> integer[]
bp_hit
🇻 Variable --> BodyPartTypeId
type_damage
🇲 Method --> ( DamageType ) -> integer
total_damage
🇲 Method --> ( ) -> integer
DiseaseTypeId
Bases
No base classes.
Constructors
- DiseaseTypeId.new( )
- DiseaseTypeId.new( DiseaseTypeId )
- DiseaseTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> DiseaseTypeId
obj
🇲 Method --> ( ) -> DiseaseTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
DistributionGrid
A grid that organizes producers, storage and consumers of a resource like electricity
Bases
No base classes.
Constructors
No constructors.
Members
empty
🇲 Method --> ( ) -> boolean
Check if grid is empty
mod_resource
🇲 Method --> ( integer, boolean? ) -> integer
get_contents
🇲 Method --> ( ) -> CppVal<coords_coord_point<tripoint,coords_origin_abs,coords_scale_map_square>>[]
Get current resource amount. Boolean argument (optional) controls recursive behavior (default true) Get vector of absolute map square coordinates of grid contents
get_resource
🇲 Method --> ( boolean? ) -> integer
Modify resource amount. First argument is amount, second (optional) controls recursive behavior (default true)
is_valid
🇲 Method --> ( ) -> boolean
Check if grid is valid
update
🇲 Method --> ( TimePoint )
Update the grid to the given time point
get_power_stat
🇲 Method --> ( ) -> PowerStat
Get power generation and consumption statistics for the grid
DistributionGridTracker
Manages all active distribution grids
Bases
No base classes.
Constructors
No constructors.
Members
grid_at
🇲 Method --> ( Tripoint ) -> DistributionGrid
🇲 Method --> ( Tripoint ) -> DistributionGrid
Get grid at absolute map square position
on_changed
🇲 Method --> ( Tripoint )
Notify tracker that a tile at the given position has changed
update
🇲 Method --> ( TimePoint )
Update all grids to the given time point
debug_grid_id
🇲 Method --> ( Tripoint ) -> integer
Get unique identifier for grid at given overmap tile (for debug purposes, returns 0 if no grid)
on_options_changed
🇲 Method --> ( )
Notify tracker that game options have changed
Effect
Bases
No base classes.
Constructors
No constructors.
Members
get_id
🇲 Method --> ( ) -> EffectTypeId
get_max_val
🇲 Method --> ( string, boolean ) -> integer
get_sizing
🇲 Method --> ( string ) -> boolean
get_percentage
🇲 Method --> ( string, integer, boolean ) -> number
get_min_val
🇲 Method --> ( string, boolean ) -> integer
get_avg_mod
🇲 Method --> ( string, boolean ) -> integer
get_amount
🇲 Method --> ( string, boolean ) -> integer
get_mod
🇲 Method --> ( string, boolean ) -> integer
get_blocks_effects
🇲 Method --> ( ) -> EffectTypeId[]
activated
🇲 Method --> ( TimePoint, string, integer, boolean, number ) -> boolean
get_addict_mod
🇲 Method --> ( string, integer ) -> number
is_permanent
🇲 Method --> ( ) -> boolean
set_permanent
🇲 Method --> ( )
has_flag
🇲 Method --> ( JsonFlagId ) -> boolean
get_int_add_val
🇲 Method --> ( ) -> integer
get_dur_add_perc
🇲 Method --> ( ) -> integer
get_int_dur_factor
🇲 Method --> ( ) -> TimeDuration
get_harmful_cough
🇲 Method --> ( ) -> boolean
get_removes_effects
🇲 Method --> ( ) -> EffectTypeId[]
get_resist_effects
🇲 Method --> ( ) -> EffectTypeId[]
get_resist_traits
🇲 Method --> ( ) -> MutationBranchId[]
get_type
🇲 Method --> ( ) -> EffectTypeRaw
decay
🇲 Method --> ( TimePoint, boolean ) -> boolean
get_duration
🇲 Method --> ( ) -> TimeDuration
use_part_descs
🇲 Method --> ( ) -> boolean
disp_desc
🇲 Method --> ( boolean ) -> string
disp_short_desc
🇲 Method --> ( boolean ) -> string
disp_name
🇲 Method --> ( ) -> string
get_max_duration
🇲 Method --> ( ) -> TimeDuration
set_duration
🇲 Method --> ( TimeDuration, boolean )
mod_duration
🇲 Method --> ( TimeDuration, boolean )
set_intensity
🇲 Method --> ( integer, boolean ) -> integer
mod_intensity
🇲 Method --> ( integer, boolean ) -> integer
get_max_intensity
🇲 Method --> ( ) -> integer
get_intensity
🇲 Method --> ( ) -> integer
get_bp
🇲 Method --> ( ) -> BodyPartTypeId
get_start_time
🇲 Method --> ( ) -> TimePoint
mult_duration
🇲 Method --> ( number, boolean )
EffectTypeId
Bases
No base classes.
Constructors
- EffectTypeId.new( )
- EffectTypeId.new( EffectTypeId )
- EffectTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> EffectTypeId
obj
🇲 Method --> ( ) -> EffectTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
Energy
Bases
No base classes.
Constructors
No constructors.
Members
from_joule
🇫 Function --> ( integer ) -> Energy
from_kilojoule
🇫 Function --> ( integer ) -> Energy
to_kilojoule
🇲 Method --> ( ) -> integer
to_joule
🇲 Method --> ( ) -> integer
ExplosionData
Bases
No base classes.
Constructors
No constructors.
Members
damage
🇻 Variable --> integer
Damage dealt by the explosion
fire
🇻 Variable --> boolean
Whether the explosion creates fire
radius
🇻 Variable --> number
Radius of the explosion
safe_range
🇲 Method --> ( ) -> integer
Returns the safe range of the explosion
FactionId
Bases
No base classes.
Constructors
- FactionId.new( )
- FactionId.new( FactionId )
- FactionId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> FactionId
obj
🇲 Method --> ( ) -> FactionRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
FactionRaw
Bases
No base classes.
Constructors
No constructors.
Members
str_id
🇲 Method --> ( ) -> FactionId
FaultId
Bases
No base classes.
Constructors
- FaultId.new( )
- FaultId.new( FaultId )
- FaultId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> FaultId
obj
🇲 Method --> ( ) -> FaultRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
FieldEmitId
Bases
No base classes.
Constructors
- FieldEmitId.new( )
- FieldEmitId.new( FieldEmitId )
- FieldEmitId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> FieldEmitId
obj
🇲 Method --> ( ) -> FieldEmitRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
FieldTypeId
Bases
No base classes.
Constructors
- FieldTypeId.new( )
- FieldTypeId.new( FieldTypeId )
- FieldTypeId.new( FieldTypeIntId )
- FieldTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> FieldTypeId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> FieldTypeRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> FieldTypeIntId
FieldTypeIntId
Bases
No base classes.
Constructors
- FieldTypeIntId.new( )
- FieldTypeIntId.new( FieldTypeIntId )
- FieldTypeIntId.new( FieldTypeId )
Members
obj
🇲 Method --> ( ) -> FieldTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> FieldTypeId
FurnId
Bases
No base classes.
Constructors
Members
NULL_ID
🇫 Function --> ( ) -> FurnId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> FurnRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> FurnIntId
FurnIntId
Bases
No base classes.
Constructors
Members
obj
🇲 Method --> ( ) -> FurnRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> FurnId
FurnRaw
Bases
No base classes.
Constructors
No constructors.
Members
transforms_into
🇻 Variable --> FurnId
open
🇻 Variable --> FurnId
close
🇻 Variable --> FurnId
set_movecost
🇲 Method --> ( integer )
set_max_volume
🇲 Method --> ( Volume )
get_coverage
🇲 Method --> ( ) -> integer
set_coverage
🇲 Method --> ( integer )
get_max_volume
🇲 Method --> ( ) -> Volume
get_movecost
🇲 Method --> ( ) -> integer
get_light_emitted
🇲 Method --> ( ) -> integer
name
🇲 Method --> ( ) -> string
int_id
🇲 Method --> ( ) -> FurnIntId
set_light_emitted
🇲 Method --> ( integer )
get_flags
🇲 Method --> ( ) -> string[]
set_flag
🇲 Method --> ( string )
has_flag
🇲 Method --> ( string ) -> boolean
str_id
🇲 Method --> ( ) -> FurnId
Inventory
Look up requirement_data by ID string. Returns nil if not found.
Represents a character's inventory
Bases
No base classes.
Constructors
- Inventory.new( )
Members
size
🇲 Method --> ( ) -> integer
Get the number of item stacks in the inventory
weight
🇲 Method --> ( ) -> Mass
Get the total weight of the inventory
volume
🇲 Method --> ( ) -> Volume
Get the total volume of the inventory
count_item
🇲 Method --> ( ItypeId ) -> integer
Count items of a specific type
find_item
🇲 Method --> ( integer ) -> Item
Find item at position
has_charges
🇲 Method --> ( ItypeId, integer ) -> boolean
Check if inventory has the specified charges
has_tools
🇲 Method --> ( ItypeId, integer ) -> boolean
Check if inventory has the specified tool
has_components
🇲 Method --> ( ItypeId, integer ) -> boolean
Check if inventory has the specified components
clear
🇲 Method --> ( )
Clear all items from the inventory
position_by_type
🇲 Method --> ( ItypeId ) -> integer
Get item position by type
IslotAmmo
Bases
RangedData
Constructors
No constructors.
Members
def_charges
🇻 Variable --> integer
Default charges
drop_active
🇻 Variable --> boolean
drop_count
🇻 Variable --> integer
force_stat_display
🇻 Variable --> boolean?
loudness
🇻 Variable --> integer
Base loudness of ammo (possibly modified by gun/gunmods)
recoil
🇻 Variable --> integer
Recoil (per shot), roughly equivalent to kinetic energy (in Joules)
drop
🇻 Variable --> ItypeId
cookoff
🇻 Variable --> boolean
Should this ammo explode in fire?
ammo_id
🇻 Variable --> AmmunitionTypeId
Ammo type, basically the "form" of the ammo that fits into the gun/tool
dont_recover_one_in
🇻 Variable --> integer
Chance to fail to recover the ammo used.
ammo_effects
🇻 Variable --> AmmunitionEffectId[]
casing_id
🇻 Variable --> ItypeId?
Type id of casings, if any
special_cookoff
🇻 Variable --> boolean
Should this ammo apply a special explosion effect when in fire?
IslotArmor
Bases
No base classes.
Constructors
No constructors.
Members
layer_data
🇻 Variable --> ArmorPortionData[]
Layer, encumbrance and coverage information
thickness
🇻 Variable --> integer
Multiplier on resistances provided by armor's materials. Damaged armors have lower effective thickness, low capped at 1. Note: 1 thickness means item retains full resistance when damaged.
valid_mods
🇻 Variable --> string[]
Whitelisted clothing mods. Restricted clothing mods must be listed here by id to be compatible.
warmth
🇻 Variable --> integer
How much warmth this item provides
weight_capacity_bonus
🇻 Variable --> Mass
Bonus to weight capacity
storage
🇻 Variable --> Volume
How much storage this items provides when worn
resistance
🇻 Variable --> Resistances
Damage negated by this armor. Usually calculated from materials+thickness
sided
🇻 Variable --> boolean
Whether this item can be worn on either side of the body
env_resist
🇻 Variable --> integer
Resistance to environmental effects
env_resist_w_filter
🇻 Variable --> integer
Environmental protection of a gas mask with installed filter
weight_capacity_modifier
🇻 Variable --> number
Factor modifying weight capacity
IslotArtifact
Bases
No base classes.
Constructors
No constructors.
Members
charge_req
🇻 Variable --> ArtifactChargeReq
effects_activated
🇻 Variable --> ArtifactEffectPassive[]
effects_carried
🇻 Variable --> ArtifactEffectActive[]
effects_wielded
🇻 Variable --> ArtifactEffectActive[]
dream_msg_unmet
🇻 Variable --> string[]
effects_worn
🇻 Variable --> ArtifactEffectActive[]
dream_freq_unmet
🇻 Variable --> integer
dream_msg_met
🇻 Variable --> string[]
charge_type
🇻 Variable --> ArtifactCharge
dream_freq_met
🇻 Variable --> integer
effects_carried_descriptions
🇲 Method --> ( ) -> string[]
effects_worn_descriptions
🇲 Method --> ( ) -> string[]
effects_wielded_descriptions
🇲 Method --> ( ) -> string[]
effects_activated_descriptions
🇲 Method --> ( ) -> string[]
effects_wielded_names
🇲 Method --> ( ) -> string[]
effects_carried_names
🇲 Method --> ( ) -> string[]
effects_worn_names
🇲 Method --> ( ) -> string[]
charge_type_description
🇲 Method --> ( ) -> string
effects_activated_names
🇲 Method --> ( ) -> string[]
charge_req_description
🇲 Method --> ( ) -> string
IslotBattery
Bases
No base classes.
Constructors
No constructors.
Members
max_capacity
🇻 Variable --> Energy
Maximum energy the battery can store
IslotBionic
Bases
No base classes.
Constructors
No constructors.
Members
bionic_id
🇻 Variable --> BionicDataId
Id of the bionic
installation_data
🇻 Variable --> ItypeId
Itemwith installation data that can be used to provide almost guaranteed successful install of corresponding bionic
difficulty
🇻 Variable --> integer
Arbitrary difficulty scale
is_upgrade
🇻 Variable --> boolean
Whether this CBM is an upgrade of another
IslotBook
Bases
No base classes.
Constructors
No constructors.
Members
time
🇻 Variable --> integer
How long in minutes it takes to read. "To read" means getting 1 skill point, not all of them.
skill
🇻 Variable --> SkillId
Which skill it upgrades, if any. Can be
SkillId.NULL_ID
skill_min
🇻 Variable --> integer
The skill level required to understand it
skill_max
🇻 Variable --> integer
The skill level the book provides
intelligence
🇻 Variable --> integer
Intelligence required to read it
martial_art
🇻 Variable --> MartialArtsId
Which martial art it teaches. Can be
MartialArtsId.NULL_ID
fun
🇻 Variable --> integer
How fun reading this is, can be negative
chapters
🇻 Variable --> integer
Fun books have chapters; after all are read, the book is less fun.
recipes
🇻 Variable --> BookRecipe[]
Recipes contained in this book
IslotBrewable
Bases
No base classes.
Constructors
No constructors.
Members
results
🇻 Variable --> ItypeId[]
What are the results of fermenting this item
time
🇻 Variable --> TimeDuration
How long for this brew to ferment
IslotComestible
Bases
No base classes.
Constructors
No constructors.
Members
comest_type
🇻 Variable --> string
comestible subtype - eg. FOOD, DRINK, MED
petfood
🇻 Variable --> string[]
pet food category
freeze_point
🇻 Variable --> integer
freezing point in degrees Fahrenheit, below this temperature item can freeze
radiation
🇻 Variable --> integer
Amount of radiation you get from this comestible
parasites
🇻 Variable --> integer
chance (odds) of becoming parasitised when eating (zero if never occurs)
rot_spawn
🇻 Variable --> MonsterGroupId
The monster group that is drawn from when the item rots away
contamination
🇻 Variable --> table<DiseaseTypeId, integer>
List of diseases carried by this comestible and their associated probability
specific_heat_solid
🇻 Variable --> number
specific_heat_liquid
🇻 Variable --> number
specific heats in J/(g K) and latent heat in J/g
monotony_penalty
🇻 Variable --> integer
A penalty applied to fun for every time this food has been eaten in the last 48 hours
latent_heat
🇻 Variable --> number
smoking_result
🇻 Variable --> ItypeId
Reference to item that will be received after smoking current item
healthy
🇻 Variable --> integer
fatigue_mod
🇻 Variable --> integer
fatigue altering effect
cooks_like
🇻 Variable --> ItypeId
Reference to other item that replaces this one as a component in recipe results
def_charges
🇻 Variable --> integer
Defaults # of charges (drugs, loaf of bread? etc)
tool
🇻 Variable --> ItypeId
tool needed to consume (e.g. lighter for cigarettes)
spoils
🇻 Variable --> TimeDuration
Time until becomes rotten at standard temperature, or zero if never spoils
quench
🇻 Variable --> integer
effect on character thirst (may be negative)
addict_value
🇻 Variable --> integer
addiction potential
stimulant_type
🇻 Variable --> integer
stimulant effect
rot_spawn_chance
🇻 Variable --> integer
Chance the above monster group spawns
addict_type
🇻 Variable --> AddictionType
effects of addiction
get_default_nutrition
🇲 Method --> ( ) -> table<VitaminId, integer>
Nutrition values to use for this type when they aren't calculated from components
get_default_nutr
🇲 Method --> ( ) -> integer
has_calories
🇲 Method --> ( ) -> boolean
IslotContainer
Bases
No base classes.
Constructors
No constructors.
Members
contains
🇻 Variable --> Volume
Inner volume of the container
unseals_into
🇻 Variable --> ItypeId
If this is set to anything but "null", changing this container's contents in any way will turn this item into that type
seals
🇻 Variable --> boolean
Can be resealed
preserves
🇻 Variable --> boolean
Contents do not spoil
watertight
🇻 Variable --> boolean
Can hold liquids
IslotEngine
Bases
No base classes.
Constructors
No constructors.
Members
displacement
🇻 Variable --> integer
For combustion engines, the displacement
IslotFuel
Bases
No base classes.
Constructors
No constructors.
Members
energy
🇻 Variable --> number
Energyof the fuel (kilojoules per charge)
has_explosion_data
🇻 Variable --> boolean
explosion_data
🇻 Variable --> CppVal<fuel_explosion>
pump_terrain
🇻 Variable --> TerIntId
IslotGun
Bases
RangedData
Constructors
No constructors.
Members
skill_used
🇻 Variable --> SkillId
What skill this gun uses
ammo_effects
🇻 Variable --> AmmunitionEffectId[]
Effects that are applied to the ammo when fired
barrel_volume
🇻 Variable --> Volume
Volumeof material removed by sawing down the barrel, if left unspecified barrel can't be sawed down
min_cycle_recoil
🇻 Variable --> integer
Minimum ammo recoil for gun to be able to fire more than once per attack
recoil
🇻 Variable --> integer
Additional recoil applied per shot before effects of handling are considered, useful for adding recoil effect to guns which otherwise consume no ammo
built_in_mods
🇻 Variable --> ItypeId[]
Built in mods. string is id of mod. These mods will get the IRREMOVABLE flag set
burst
🇻 Variable --> integer
Burst size for AUTO mode (legacy field for items not migrated to specify modes )
default_mods
🇻 Variable --> ItypeId[]
Default mods, string is id of mod. These mods are removable but are default on the weapon
handling
🇻 Variable --> integer
How easy is control of recoil? If unset value automatically derived from weapon type
ups_charges
🇻 Variable --> integer
If this uses UPS charges, how many (per shoot), 0 for no UPS charges at all
blackpowder_tolerance
🇻 Variable --> integer
One in X chance for gun to require major cleanup after firing blackpowder shot
sight_dispersion
🇻 Variable --> integer
Maximum aim achievable using base weapon sights
loudness
🇻 Variable --> integer
Modifies base loudness as provided by the currently loaded ammo
durability
🇻 Variable --> integer
Gun durability, affects gun being damaged during shooting
ammo
🇻 Variable --> AmmunitionTypeId[]
What type of ammo this gun uses
reload_time
🇻 Variable --> integer
Reload time, in moves
clip
🇻 Variable --> integer
For guns with an integral magazine what is the capacity?
ammo_to_fire
🇻 Variable --> integer
How much ammo is consumed per shot
reload_noise
🇻 Variable --> string
Noise displayed when reloading the weapon
reload_noise_volume
🇻 Variable --> integer
Volumeof the noise made when reloading this weapon
get_gunmod_locations
🇲 Method --> ( ) -> table<string, integer>
Location for gun mods. Key is the location (untranslated!), value is the number of mods that the location can have. The value should be > 0
get_modes
🇲 Method --> ( ) -> string[]
Firing modes are supported by the gun. Always contains at least DEFAULT mode
IslotGunmod
Bases
RangedData
Constructors
No constructors.
Members
ammo_to_fire_multiplier
🇻 Variable --> number
Increases base gun ammo to fire by this many times per shot
ammo_to_fire_modifier
🇻 Variable --> integer
Increases base gun ammo to fire by this value per shot
min_str_required_mod
🇻 Variable --> integer
Modifies base strength required
ups_charges_modifier
🇻 Variable --> integer
Increases base gun UPS consumption by this value per shot
weight_multiplier
🇻 Variable --> number
Increases gun weight by this many times
ammo_effects
🇻 Variable --> AmmunitionEffectId[]
consume_divisor
🇻 Variable --> integer
Divsor to scale back gunmod consumption damage. lower is more damaging. Affected by ammo loudness and recoil, see ranged.cpp for how much.
handling
🇻 Variable --> integer
Relative adjustment to base gun handling
reload_modifier
🇻 Variable --> integer
Percentage value change to the gun's loading time. Higher is slower
ups_charges_multiplier
🇻 Variable --> number
Increases base gun UPS consumption by this many times per shot
loudness
🇻 Variable --> integer
Modifies base loudness as provided by the currently loaded ammo
usable_category
🇻 Variable --> CppVal<std_unordered_set<string_id<weapon_category>>>[]
What category of weapons this gunmod can be used with
usable
🇻 Variable --> CppVal<std_unordered_set<string_id<itype>>>
What kind of weapons this gunmod can be used with
install_time
🇻 Variable --> integer
How many moves does this gunmod take to install?
exclusion
🇻 Variable --> CppVal<std_unordered_set<string_id<itype>>>
What kind of weapons this gunmod can't be used with
sight_dispersion
🇻 Variable --> integer
If this value is set (non-negative), this gunmod functions as a sight. A sight is only usable to aim by a character whose current
Character::recoil is at or below this value.
exclusion_category
🇻 Variable --> CppVal<std_unordered_set<string_id<weapon_category>>>[]
What category of weapons this gunmod can't be used with
aim_speed
🇻 Variable --> integer
For sights (see @ref sight_dispersion), this value affects time cost of aiming. Higher is better. In case of multiple usable sights, the one with highest aim speed is used.
consume_chance
🇻 Variable --> integer
Percentage value change to the gun's loading time. Higher is less likely
get_location
🇲 Method --> ( ) -> string
Where is this gunmod installed (e.g. "stock", "rail")?
get_added_slots
🇲 Method --> ( ) -> table<string, integer>
Additional gunmod slots to add to the gun
get_mode_modifiers
🇲 Method --> ( ) -> string[]
Firing modes added to or replacing those of the base gun
get_mod_blacklist
🇲 Method --> ( ) -> string[]
Not compatible on weapons that have this mod slot
IslotMagazine
Bases
No base classes.
Constructors
No constructors.
Members
default_ammo
🇻 Variable --> ItypeId
Default type of ammo contained by a magazine (often set for ammo belts)
protects_contents
🇻 Variable --> boolean
If false, ammo will cook off if this mag is affected by fire
reliability
🇻 Variable --> integer
How reliable this magazine on a range of 0 to 10?
reload_time
🇻 Variable --> integer
How long it takes to load each unit of ammo into the magazine
linkage
🇻 Variable --> ItypeId?
For ammo belts one linkage (of given type) is dropped for each unit of ammo consumed
capacity
🇻 Variable --> integer
Capacity of magazine (in equivalent units to ammo charges)
count
🇻 Variable --> integer
Default amount of ammo contained by a magazine (often set for ammo belts)
ammo_type
🇻 Variable --> AmmunitionTypeId[]
What type of ammo this magazine can be loaded with
IslotMilling
Bases
No base classes.
Constructors
No constructors.
Members
conversion_rate
🇻 Variable --> integer
converts_into
🇻 Variable --> ItypeId
IslotMod
Bases
No base classes.
Constructors
No constructors.
Members
acceptable_ammo
🇻 Variable --> AmmunitionTypeId[]
If non-empty restrict mod to items with those base (before modifiers) ammo types
capacity_multiplier
🇻 Variable --> number
Proportional adjustment of parent item ammo capacity
ammo_modifier
🇻 Variable --> AmmunitionTypeId[]
If set modifies parent ammo to this type
magazine_adaptor
🇻 Variable --> table<AmmunitionTypeId, ItypeId[]>
If non-empty replaces the compatible magazines for the parent item
IslotPetArmor
Bases
No base classes.
Constructors
No constructors.
Members
min_vol
🇻 Variable --> Volume
The minimum volume a pet can be and wear this armor
storage
🇻 Variable --> Volume
How much storage this items provides when worn
thickness
🇻 Variable --> integer
Multiplier on resistances provided by this armor
env_resist_w_filter
🇻 Variable --> integer
Environmental protection of a gas mask with installed filter
max_vol
🇻 Variable --> Volume
The maximum volume a pet can be and wear this armor
env_resist
🇻 Variable --> integer
Resistance to environmental effects
bodytype
🇻 Variable --> string
What animal bodytype can wear this armor
IslotSeed
Bases
No base classes.
Constructors
No constructors.
Members
fruit_div
🇻 Variable --> integer
Amount of harvested charges of fruits is divided by this number.
byproducts
🇻 Variable --> ItypeId[]
Additionally items (a list of their item ids) that will spawn when harvesting the plant.
grow
🇻 Variable --> TimeDuration
Time it takes for a seed to grow (based of off a season length of 91 days).
fruit_id
🇻 Variable --> ItypeId
Type id of the fruit item.
get_plant_name
🇲 Method --> ( integer ) -> string
Name of the plant.
IslotTool
Bases
No base classes.
Constructors
No constructors.
Members
charge_factor
🇻 Variable --> integer
revert_to
🇻 Variable --> ItypeId?
revert_msg
🇻 Variable --> string
subtype
🇻 Variable --> ItypeId
turns_per_charge
🇻 Variable --> integer
turns_active
🇻 Variable --> integer
ups_eff_mult
🇻 Variable --> integer
rand_charges
🇻 Variable --> integer[]
max_charges
🇻 Variable --> integer
ammo_id
🇻 Variable --> AmmunitionTypeId[]
power_draw
🇻 Variable --> integer
charges_per_use
🇻 Variable --> integer
default_ammo
🇻 Variable --> ItypeId
def_charges
🇻 Variable --> integer
ups_recharge_rate
🇻 Variable --> integer
IslotWheel
Bases
No base classes.
Constructors
No constructors.
Members
diameter
🇻 Variable --> integer
Diameter of wheel in millimeters. Integer JSON values are legacy inches.
width
🇻 Variable --> integer
Width of wheel in millimeters. Integer JSON values are legacy inches.
Item
Bases
No base classes.
Constructors
No constructors.
Members
charges
🇻 Variable --> integer
remaining_capacity_for_id
🇲 Method --> ( ItypeId, boolean ) -> integer
Gets the remaining space available for a type of liquid
get_type
🇲 Method --> ( ) -> ItypeId
total_capacity
🇲 Method --> ( ) -> Volume
Gets maximum volume this item can hold (liquids, ammo, etc)
current_magazine
🇲 Method --> ( ) -> Item
Gets the current magazine
can_contain
🇲 Method --> ( Item ) -> boolean
Checks if this item can contain another
add_technique
🇲 Method --> ( MartialArtsTechniqueId )
Adds the technique. It isn't treated original, but additional.
remove_technique
🇲 Method --> ( MartialArtsTechniqueId )
Removes the additional technique. Doesn't affect originial techniques.
ammo_capacity
🇲 Method --> ( boolean ) -> integer
Gets the maximum capacity of a magazine
ammo_remaining
🇲 Method --> ( ) -> integer
Get remaining ammo, works with batteries & stuff too
ammo_data
🇲 Method --> ( ) -> ItypeRaw
ammo_set
🇲 Method --> ( ItypeId, integer )
ammo_unset
🇲 Method --> ( )
get_techniques
🇲 Method --> ( ) -> MartialArtsTechniqueId[]
Gets all techniques. Including original techniques.
ammo_consume
🇲 Method --> ( integer, Tripoint ) -> integer
ammo_required
🇲 Method --> ( ) -> integer
ammo_current
🇲 Method --> ( ) -> ItypeId
has_technique
🇲 Method --> ( MartialArtsTechniqueId ) -> boolean
Checks if this item has the technique as an addition. Doesn't check original techniques.
is_owned_by
🇲 Method --> ( Character, boolean ) -> boolean
Checks if this item owned by a character
get_owner_name
🇲 Method --> ( ) -> string
mod_charges
🇲 Method --> ( integer )
made_of
🇲 Method --> ( ) -> MaterialTypeId[]
is_made_of
🇲 Method --> ( MaterialTypeId ) -> boolean
has_infinite_charges
🇲 Method --> ( ) -> boolean
is_stackable
🇲 Method --> ( ) -> boolean
energy_remaining
🇲 Method --> ( ) -> Energy
get_reload_time
🇲 Method --> ( ) -> integer
get_kcal
🇲 Method --> ( ) -> integer
get_comestible_fun
🇲 Method --> ( ) -> integer
set_owner
🇲 Method --> ( FactionId )
Sets the ownership of this item to a faction
set_owner
🇲 Method --> ( Character )
Sets the ownership of this item to a character
get_quench
🇲 Method --> ( ) -> integer
get_owner
🇲 Method --> ( ) -> FactionId
Gets the faction id that owns this item
get_rot
🇲 Method --> ( ) -> TimeDuration
Gets the
TimeDurationuntil this item rots
get_category_id
🇲 Method --> ( ) -> string
Gets the category id this item is in
conductive
🇲 Method --> ( ) -> boolean
add_item_with_id
🇲 Method --> ( ItypeId, integer )
Adds an item(s) to contents
covers
🇲 Method --> ( BodyPartTypeIntId ) -> boolean
Checks if the item covers a bodypart
mod_damage
🇲 Method --> ( integer ) -> boolean
🇲 Method --> ( integer, DamageType ) -> boolean
Modify item damage by given amount. Returns true if item should be destroyed.
get_melee_damage_bonus
🇲 Method --> ( ) -> DamageInstance
get_melee_hit_bonus
🇲 Method --> ( ) -> integer
set_damage
🇲 Method --> ( integer )
Set item damage to specified value. Clamped between min_damage and max_damage.
get_max_damage
🇲 Method --> ( ) -> integer
Get maximum possible damage value before item is destroyed. Default is 4000, configurable via 'damage_states' in JSON.
get_relative_health
🇲 Method --> ( ) -> number
Get relative health as ratio 0.0-1.0, where 1.0 is undamaged and 0.0 is destroyed
get_min_damage
🇲 Method --> ( ) -> integer
Get minimum possible damage value (can be negative for reinforced items). Default is -1000, configurable via 'damage_states' in JSON.
get_ranged_damage_bonus
🇲 Method --> ( ) -> DamageInstance
get_dispersion_bonus
🇲 Method --> ( ) -> integer
set_ranged_damage_bonus
🇲 Method --> ( DamageInstance )
set_range_bonus
🇲 Method --> ( integer )
get_range_bonus
🇲 Method --> ( ) -> integer
set_melee_hit_bonus
🇲 Method --> ( integer )
get_recoil_bonus
🇲 Method --> ( ) -> integer
set_melee_damage_bonus
🇲 Method --> ( DamageInstance )
has_item_with_id
🇲 Method --> ( ItypeId ) -> boolean
Checks item contents for a given item id
get_damage_level
🇲 Method --> ( ) -> integer
🇲 Method --> ( integer ) -> integer
Get item damage as a level from 0 to max. Used for UI display and damage thresholds.
stamina_cost
🇲 Method --> ( ) -> integer
has_own_flag
🇲 Method --> ( JsonFlagId ) -> boolean
set_flag_recursive
🇲 Method --> ( JsonFlagId )
unset_flags
🇲 Method --> ( )
has_flag
🇲 Method --> ( JsonFlagId ) -> boolean
set_flag
🇲 Method --> ( JsonFlagId )
unset_flag
🇲 Method --> ( JsonFlagId )
get_damage
🇲 Method --> ( ) -> integer
Get current item damage value (durability). Higher values mean more damaged. Default range is -1000 (min) to 4000 (max), configurable via 'damage_states' in JSON.
convert
🇲 Method --> ( ItypeId )
Converts the item as given
<code>[ItypeId](#sol::ItypeId)</code>.
get_var_num
🇲 Method --> ( string, number ) -> number
Get variable as float number
set_var_tri
🇲 Method --> ( string, Tripoint )
attack_cost
🇲 Method --> ( ) -> integer
get_var_str
🇲 Method --> ( string, string ) -> string
Get variable as string
set_var_num
🇲 Method --> ( string, number )
get_var_tri
🇲 Method --> ( string, Tripoint ) -> Tripoint
Get variable as tripoint
set_var_str
🇲 Method --> ( string, string )
set_dispersion_bonus
🇲 Method --> ( integer )
is_melee
🇲 Method --> ( DamageType ) -> boolean
Is this item an effective melee weapon for the given damage type?
is_bandolier
🇲 Method --> ( ) -> boolean
is_holster
🇲 Method --> ( ) -> boolean
is_ammo
🇲 Method --> ( ) -> boolean
is_ammo_belt
🇲 Method --> ( ) -> boolean
is_gunmod
🇲 Method --> ( ) -> boolean
is_bionic
🇲 Method --> ( ) -> boolean
is_silent
🇲 Method --> ( ) -> boolean
is_firearm
🇲 Method --> ( ) -> boolean
is_comestible
🇲 Method --> ( ) -> boolean
is_medication
🇲 Method --> ( ) -> boolean
is_corpse
🇲 Method --> ( ) -> boolean
is_ammo_container
🇲 Method --> ( ) -> boolean
is_food
🇲 Method --> ( ) -> boolean
is_med_container
🇲 Method --> ( ) -> boolean
is_brewable
🇲 Method --> ( ) -> boolean
is_food_container
🇲 Method --> ( ) -> boolean
is_armor
🇲 Method --> ( ) -> boolean
is_gun
🇲 Method --> ( ) -> boolean
is_power_armor
🇲 Method --> ( ) -> boolean
weight
🇲 Method --> ( boolean?, boolean? ) -> Mass
Weight of the item. The first
boolis whether including contents, secondboolis whether it isintegral_weight.
volume
🇲 Method --> ( boolean? ) -> Volume
Volumeof the item.boolis whether it isintegral_volume.
price
🇲 Method --> ( boolean ) -> number
Cents of the item.
boolis whether it is a post-cataclysm value.
display_name
🇲 Method --> ( integer ) -> string
Display name with all bells and whistles like ammo and prefixes
get_mtype
🇲 Method --> ( ) -> MonsterTypeId
Almost for a corpse.
tname
🇲 Method --> ( integer, boolean, integer ) -> string
Translated item name with prefixes
is_money
🇲 Method --> ( ) -> boolean
has_var
🇲 Method --> ( string ) -> boolean
Check for variable of any type
clear_vars
🇲 Method --> ( )
Erase all variables
is_unarmed_weapon
🇲 Method --> ( ) -> boolean
is_sided
🇲 Method --> ( ) -> boolean
erase_var
🇲 Method --> ( string )
Erase variable
is_null
🇲 Method --> ( ) -> boolean
vars_table
🇫 Function --> ( Item ) -> table
Returns all stored item vars as a table
spawn
🇫 Function --> ( ItypeId, integer ) -> Detached<Item>
Spawns a new item. Same as gapi.create_item
is_magazine
🇲 Method --> ( ) -> boolean
Is this a magazine? (batteries are magazines)
is_book
🇲 Method --> ( ) -> boolean
is_container
🇲 Method --> ( ) -> boolean
is_tainted
🇲 Method --> ( ) -> boolean
is_soft
🇲 Method --> ( ) -> boolean
is_reloadable
🇲 Method --> ( ) -> boolean
is_dangerous
🇲 Method --> ( ) -> boolean
is_relic
🇲 Method --> ( ) -> boolean
is_seed
🇲 Method --> ( ) -> boolean
is_artifact
🇲 Method --> ( ) -> boolean
is_upgrade
🇲 Method --> ( ) -> boolean
set_counter
🇲 Method --> ( integer )
get_counter
🇲 Method --> ( ) -> integer
is_active
🇲 Method --> ( ) -> boolean
set_charges
🇲 Method --> ( integer )
activate
🇲 Method --> ( )
deactivate
🇲 Method --> ( )
is_map
🇲 Method --> ( ) -> boolean
is_transformable
🇲 Method --> ( ) -> boolean
is_deployable
🇲 Method --> ( ) -> boolean
is_bucket_nonempty
🇲 Method --> ( ) -> boolean
is_engine
🇲 Method --> ( ) -> boolean
is_wheel
🇲 Method --> ( ) -> boolean
is_bucket
🇲 Method --> ( ) -> boolean
is_watertight_container
🇲 Method --> ( ) -> boolean
is_non_resealable_container
🇲 Method --> ( ) -> boolean
is_tool
🇲 Method --> ( ) -> boolean
is_fuel
🇲 Method --> ( ) -> boolean
is_faulty
🇲 Method --> ( ) -> boolean
is_craft
🇲 Method --> ( ) -> boolean
is_emissive
🇲 Method --> ( ) -> boolean
is_toolmod
🇲 Method --> ( ) -> boolean
is_salvageable
🇲 Method --> ( boolean ) -> boolean
is_irremovable
🇲 Method --> ( ) -> boolean
is_container_empty
🇲 Method --> ( ) -> boolean
set_recoil_bonus
🇲 Method --> ( integer )
ItemStack
Iterate over this using pairs() for reading. Can also be indexed.
Bases
No base classes.
Constructors
No constructors.
Members
stacks_with
free_volume
🇲 Method --> ( ) -> Volume
count_limit
🇲 Method --> ( ) -> integer
amount_can_fit
🇲 Method --> ( Item ) -> integer
stored_volume
🇲 Method --> ( ) -> Volume
move_all_to
🇲 Method --> ( ItemStack )
max_volume
🇲 Method --> ( ) -> Volume
only_item
🇲 Method --> ( ) -> Item
count
🇲 Method --> ( ) -> integer
insert
🇲 Method --> ( Detached<Item> )
clear
🇲 Method --> ( ) -> Detached<Item>[]
items
🇲 Method --> ( ) -> Item[]
Modifying the stack while iterating may cause problems. This returns a frozen copy of the items in the stack for safe modification of the stack (eg. removing items while iterating).
remove
🇲 Method --> ( Item ) -> Detached<Item>
ItypeId
Bases
No base classes.
Constructors
- ItypeId.new( )
- ItypeId.new( ItypeId )
- ItypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> ItypeId
obj
🇲 Method --> ( ) -> ItypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
ItypeRaw
Slots for various item type properties. Each slot may contain a valid value or nil
Bases
No base classes.
Constructors
No constructors.
Members
attacks
🇻 Variable --> table<string, CppVal<attack_statblock>>
light_emission
🇻 Variable --> integer
layer
🇻 Variable --> CppVal<layer_level>
item_tags
🇻 Variable --> JsonFlagId[]
looks_like
🇻 Variable --> ItypeId
min_dex
🇻 Variable --> integer
materials
🇻 Variable --> MaterialTypeId[]
min_int
🇻 Variable --> integer
min_per
🇻 Variable --> integer
integral_weight
🇻 Variable --> Mass
faults
🇻 Variable --> FaultId[]
countdown_destroy
🇻 Variable --> boolean
explosion_data
🇻 Variable --> ExplosionData
integral_volume
🇻 Variable --> Volume
countdown_interval
🇻 Variable --> integer
emits
🇻 Variable --> FieldEmitId[]
default_container
🇻 Variable --> ItypeId?
explode_in_fire
🇻 Variable --> boolean
melee_to_hit
🇻 Variable --> integer
min_skills
🇻 Variable --> table<SkillId, integer>
phase
🇻 Variable --> Phase
thrown_damage
🇻 Variable --> DamageInstance
techniques
🇻 Variable --> MartialArtsTechniqueId[]
min_str
🇻 Variable --> integer
volume
🇻 Variable --> Volume
weight
🇻 Variable --> Mass
weapon_category
🇻 Variable --> WeaponCategoryId[]
rigid
🇻 Variable --> boolean
stack_size
🇻 Variable --> integer
repair
🇻 Variable --> ItypeId[]
repairs_like
🇻 Variable --> ItypeId
qualities
🇻 Variable --> table<QualityId, integer>
properties
🇻 Variable --> table<string, string>
recipes
🇻 Variable --> RecipeId[]
get_description
🇲 Method --> ( integer ) -> string
get_countdown_action
🇲 Method --> ( ) -> string
price_post
🇲 Method --> ( ) -> integer
price
🇲 Method --> ( ) -> integer
slot_container
🇲 Method --> ( ) -> IslotContainer
source_mod
🇲 Method --> ( ) -> ModInfoId[]
get_name
🇲 Method --> ( integer ) -> string
slot_gun
🇲 Method --> ( ) -> IslotGun
slot_fuel
🇲 Method --> ( ) -> IslotFuel
slot_wheel
🇲 Method --> ( ) -> IslotWheel
slot_gunmod
🇲 Method --> ( ) -> IslotGunmod
slot_battery
🇲 Method --> ( ) -> IslotBattery
slot_magazine
🇲 Method --> ( ) -> IslotMagazine
slot_bionic
🇲 Method --> ( ) -> IslotBionic
slot_ammo
🇲 Method --> ( ) -> IslotAmmo
slot_engine
🇲 Method --> ( ) -> IslotEngine
slot_book
🇲 Method --> ( ) -> IslotBook
slot_comestible
🇲 Method --> ( ) -> IslotComestible
slot_tool
🇲 Method --> ( ) -> IslotTool
slot_mod
🇲 Method --> ( ) -> IslotMod
slot_brewable
🇲 Method --> ( ) -> IslotBrewable
slot_pet_armor
🇲 Method --> ( ) -> IslotPetArmor
slot_armor
🇲 Method --> ( ) -> IslotArmor
get_drop_action
🇲 Method --> ( ) -> string
slot_seed
🇲 Method --> ( ) -> IslotSeed
slot_relic
🇲 Method --> ( ) -> Relic
damage_min
🇲 Method --> ( ) -> integer
damage_max
🇲 Method --> ( ) -> integer
is_stackable
🇲 Method --> ( ) -> boolean
get_flags
🇲 Method --> ( ) -> JsonFlagId[]
has_use
🇲 Method --> ( ) -> boolean
has_flag
🇲 Method --> ( JsonFlagId ) -> boolean
maximum_charges
🇲 Method --> ( ) -> integer
slot_artifact
🇲 Method --> ( ) -> IslotArtifact
charges_to_use
🇲 Method --> ( ) -> integer
charges_default
🇲 Method --> ( ) -> integer
type_id
🇲 Method --> ( ) -> ItypeId
slot_milling
🇲 Method --> ( ) -> IslotMilling
charges_per_volume
🇲 Method --> ( Volume ) -> integer
can_have_charges
🇲 Method --> ( ) -> boolean
charge_factor
🇲 Method --> ( ) -> integer
can_use
🇲 Method --> ( string ) -> boolean
get_uses
🇲 Method --> ( ) -> string[]
JsonFlagId
Bases
No base classes.
Constructors
- JsonFlagId.new( )
- JsonFlagId.new( JsonFlagId )
- JsonFlagId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> JsonFlagId
obj
🇲 Method --> ( ) -> JsonFlagRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
JsonTraitFlagId
Bases
No base classes.
Constructors
- JsonTraitFlagId.new( )
- JsonTraitFlagId.new( JsonTraitFlagId )
- JsonTraitFlagId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> JsonTraitFlagId
obj
🇲 Method --> ( ) -> JsonTraitFlagRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
KnownMagic
Represents a character's spellbook and mana pool. Manages all spells known by a character, their mana, and spell learning/forgetting.
Bases
No base classes.
Constructors
No constructors.
Members
casting_ignore
🇻 Variable --> boolean
Whether casting ignores all distractions. Can be read and written.
set_mana
🇲 Method --> ( integer )
Set the current mana to a specific value.
max_mana
🇲 Method --> ( Character ) -> integer
Get the maximum mana for the given character.
mod_mana
🇲 Method --> ( Character, integer )
Modify the current mana by adding or subtracting an amount.
has_enough_energy
🇲 Method --> ( Character, Spell ) -> boolean
Check if the character has enough energy (of the appropriate type) to cast the given spell.
mana_regen_rate
🇲 Method --> ( Character ) -> number
Get the mana regeneration rate in units per turn for the given character.
time_to_learn_spell
🇲 Method --> ( Character, SpellTypeId ) -> integer
Calculate the time in moves required for the character to memorize/learn a spell.
available_mana
🇲 Method --> ( ) -> integer
Get the current available mana.
get_spells
🇲 Method --> ( ) -> Spell[]
Get all known spells as a vector of spell pointers.
learn_spell
🇲 Method --> ( SpellTypeId, Character, boolean? )
Learn a new spell. Requires a
Characterreference and spell_id. Optional force(boolean) parameter bypasses restrictions.
spells
🇲 Method --> ( ) -> SpellTypeId[]
Get a vector of all known spell IDs.
forget_spell
🇲 Method --> ( SpellTypeId )
Forget a known spell by spell_id.
get_spell
🇲 Method --> ( SpellTypeId ) -> Spell
Get a reference to a known spell for editing. Returns the spell associated with the given spell_id.
can_learn_spell
🇲 Method --> ( Character, SpellTypeId ) -> boolean
Check if the character can learn a specific spell, considering traits and other restrictions.
knows_spell
🇲 Method --> ( SpellTypeId ) -> boolean
🇲 Method --> ( ) -> boolean
Check if the character knows a specific spell by spell_id.
Map
Bases
No base classes.
Constructors
No constructors.
Members
get_abs_ms
🇲 Method --> ( Tripoint ) -> Tripoint
Convert local ms -> absolute ms
set_field_int_at
🇲 Method --> ( Tripoint, FieldTypeIntId, integer, boolean ) -> integer
mod_field_age_at
🇲 Method --> ( Tripoint, FieldTypeIntId, TimeDuration ) -> TimeDuration
set_field_age_at
🇲 Method --> ( Tripoint, FieldTypeIntId, TimeDuration, boolean ) -> TimeDuration
add_field_at
🇲 Method --> ( Tripoint, FieldTypeIntId, integer, TimeDuration ) -> boolean
remove_field_at
🇲 Method --> ( Tripoint, FieldTypeIntId )
mod_field_int_at
🇲 Method --> ( Tripoint, FieldTypeIntId, integer ) -> integer
get_field_int_at
🇲 Method --> ( Tripoint, FieldTypeIntId ) -> integer
get_field_age_at
🇲 Method --> ( Tripoint, FieldTypeIntId ) -> TimeDuration
set_furn_at
🇲 Method --> ( Tripoint, FurnIntId )
has_field_at
🇲 Method --> ( Tripoint, FieldTypeIntId ) -> boolean
get_furn_at
🇲 Method --> ( Tripoint ) -> FurnIntId
get_field_name_at
🇲 Method --> ( Tripoint, FieldTypeIntId ) -> string
set_trap_at
🇲 Method --> ( Tripoint, TrapIntId )
Set a trap at a position on the map. It can also replace existing trap, even with
trap_null.
is_ot_match
🇫 Function --> ( string, OterIntId, OtMatchType ) -> boolean
draw_fill_background
🇲 Method --> ( string )
place_spawns
🇲 Method --> ( string, integer, Point, Point, number, boolean )
get_trap_at
🇲 Method --> ( Tripoint ) -> TrapIntId
is_in_sunlight
🇲 Method --> ( Tripoint ) -> boolean
is_outside
🇲 Method --> ( Tripoint ) -> boolean
is_sheltered
🇲 Method --> ( Tripoint ) -> boolean
disarm_trap_at
🇲 Method --> ( Tripoint )
Disarms a trap using your skills and stats, with consequences depending on success or failure.
remove_trap_at
🇲 Method --> ( Tripoint )
Simpler version of
set_trap_atwithtrap_null.
place_items
🇲 Method --> ( string, integer, Point, Point, boolean )
set_ter_at_xyz
🇲 Method --> ( integer, integer, integer, TerIntId ) -> boolean
set_ter_at
🇲 Method --> ( Tripoint, TerIntId ) -> boolean
spawn_artifact_at
🇲 Method --> ( Tripoint )
Spawns a random artifact at a position on the map.
create_item_at
🇲 Method --> ( Tripoint, ItypeId, integer ) -> Item
Creates a new item(s) at a position on the map.
spawn_natural_artifact_at
🇲 Method --> ( Tripoint, string? )
Spawns a natural artifact at a position on the map. Omit
propertyto choose one at random.
create_corpse_at
🇲 Method --> ( Tripoint, MonsterTypeId?, TimePoint?, string?, integer? )
Creates a new corpse at a position on the map. You can skip
Optones by omitting them or passingnil.MtypeIdspecifies which monster's body it is,<code>[TimePoint](#sol::TimePoint)</code>indicates when it died,stringgives it a custom name, andintdetermines the revival time if the monster has theREVIVESflag.
has_items_at
🇲 Method --> ( Tripoint ) -> boolean
place_npc
🇲 Method --> ( Point, string ) -> Npc
Forcibly places an npc using a template at a position on the map. Returns the npc.
get_map_size
🇲 Method --> ( ) -> integer
In map squares
ambient_light_at
🇲 Method --> ( Tripoint ) -> number
get_local_ms
🇲 Method --> ( Tripoint ) -> Tripoint
Convert absolute ms -> local ms
get_map_size_in_submaps
🇲 Method --> ( ) -> integer
get_ter_at_xyz
🇲 Method --> ( integer, integer, integer ) -> TerIntId
Coordinate-based variants that avoid allocating a
Tripointobject.
remove_item_at
🇲 Method --> ( Tripoint, Item )
add_item
🇲 Method --> ( Tripoint, Detached<Item> ) -> Detached<Item>
Places a detached item onto the map. Returns nil on success (item now owned by map), or returns the item back if placement failed.
replace_vehicle
🇲 Method --> ( WrappedVehicle, string, table? ) -> boolean
🇲 Method --> ( Tripoint, string, table? ) -> boolean
Replaces a specific vehicle with a different prototype, preserving origin tile by default. Pass an optional table with
orientation(Angleor degrees),status, andlocksto override spawn settings.
move_item_to
🇲 Method --> ( Tripoint, Item, Tripoint )
Moves an item from one position to another, preserving all item state including contents.
get_ter_at
🇲 Method --> ( Tripoint ) -> TerIntId
detach_item_at
🇲 Method --> ( Tripoint, Item ) -> Detached<Item>
Removes an item from the map and returns it as a detached_ptr. The item is now owned by Lua - store it in a table to keep it alive, or let it be GC'd to destroy it. Use add_item to place it back on a map.
get_vehicles
🇲 Method --> ( ) -> WrappedVehicle[]
Returns every vehicle currently on the map.
get_items_in_radius
🇲 Method --> ( Tripoint, integer ) -> MapStack[]
points_in_radius
🇲 Method --> ( Tripoint, integer, integer? ) -> Tripoint[]
Returns all points within a radius from the center point.
radiuszdefaults to 0.
clear_items_at
🇲 Method --> ( Tripoint )
get_items_at
🇲 Method --> ( Tripoint ) -> MapStack
rotate
🇲 Method --> ( integer )
MapStack
Bases
ItemStack
Constructors
No constructors.
Members
as_item_stack
🇲 Method --> ( ) -> ItemStack
MapgenData
Bases
No base classes.
Constructors
No constructors.
Members
id
🇲 Method --> ( ) -> OterIntId
Gets it's oter id.
zlevel
🇲 Method --> ( ) -> integer
Gets the z-level that it is generated at.
get_nesw
🇲 Method --> ( integer ) -> OterIntId
Returns t_nesw at index i
below
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the below.
set_dir
🇲 Method --> ( integer, integer )
Sets the direction of the mapgen.
get_rot_suffix
🇲 Method --> ( ) -> string
Gets rotation string
get_rotation
🇲 Method --> ( ) -> integer
Gets rotation
fill_groundcover
🇲 Method --> ( )
Fills the ground with default terrain.
nest
🇲 Method --> ( string, Point )
Generates Nested Mapgen
above
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the above.
swest
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the swest.
east
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the east.
north
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the north.
nwest
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the nwest.
south
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the south.
neast
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the neast.
west
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the west.
seast
🇲 Method --> ( ) -> OterIntId
Gets the oter id to the seast.
generate
🇲 Method --> ( string )
Generates Normal Mapgen
MartialArtsBuffId
Bases
No base classes.
Constructors
- MartialArtsBuffId.new( )
- MartialArtsBuffId.new( MartialArtsBuffId )
- MartialArtsBuffId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MartialArtsBuffId
obj
🇲 Method --> ( ) -> MartialArtsBuffRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MartialArtsId
Bases
No base classes.
Constructors
- MartialArtsId.new( )
- MartialArtsId.new( MartialArtsId )
- MartialArtsId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MartialArtsId
obj
🇲 Method --> ( ) -> MartialArtsRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MartialArtsTechniqueId
Bases
No base classes.
Constructors
- MartialArtsTechniqueId.new( )
- MartialArtsTechniqueId.new( MartialArtsTechniqueId )
- MartialArtsTechniqueId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MartialArtsTechniqueId
obj
🇲 Method --> ( ) -> MartialArtsTechniqueRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MartialArtsTechniqueRaw
Bases
No base classes.
Constructors
No constructors.
Members
name
🇻 Variable --> string
disarms
🇻 Variable --> boolean
knockback_follow
🇻 Variable --> boolean
crit_ok
🇻 Variable --> boolean
crit_tec
🇻 Variable --> boolean
take_weapon
🇻 Variable --> boolean
block_counter
🇻 Variable --> boolean
dodge_counter
🇻 Variable --> boolean
miss_recovery
🇻 Variable --> boolean
grab_break
🇻 Variable --> boolean
powerful_knockback
🇻 Variable --> boolean
knockback_dist
🇻 Variable --> integer
npc_message
🇻 Variable --> string
avatar_message
🇻 Variable --> string
knockback_spread
🇻 Variable --> number
defensive
🇻 Variable --> boolean
down_dur
🇻 Variable --> integer
side_switch
🇻 Variable --> boolean
force_unarmed
🇻 Variable --> boolean
stun_dur
🇻 Variable --> integer
get_description
🇲 Method --> ( ) -> string
Mass
Bases
No base classes.
Constructors
No constructors.
Members
from_milligram
🇫 Function --> ( integer ) -> Mass
from_newton
🇫 Function --> ( integer ) -> Mass
to_newton
🇲 Method --> ( ) -> integer
from_kilogram
🇫 Function --> ( integer ) -> Mass
to_kilogram
🇲 Method --> ( ) -> integer
to_milligram
🇲 Method --> ( ) -> integer
to_gram
🇲 Method --> ( ) -> integer
from_gram
🇫 Function --> ( integer ) -> Mass
MaterialTypeId
Bases
No base classes.
Constructors
- MaterialTypeId.new( )
- MaterialTypeId.new( MaterialTypeId )
- MaterialTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MaterialTypeId
obj
🇲 Method --> ( ) -> MaterialTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MaterialTypeRaw
Bases
No base classes.
Constructors
No constructors.
Members
str_id
🇲 Method --> ( ) -> MaterialTypeId
name
🇲 Method --> ( ) -> string
Mission
Bases
No base classes.
Constructors
- Mission.new( )
Members
name
🇲 Method --> ( ) -> string
Returns the mission's name as a string.
wrap_up
🇲 Method --> ( )
Wraps up the mission successfully.
has_failed
🇲 Method --> ( ) -> boolean
Returns true if the mission has failed.
fail
🇲 Method --> ( )
Fails the mission.
is_assigned
🇲 Method --> ( ) -> boolean
Returns true if the mission is currently assigned.
has_generic_rewards
🇲 Method --> ( ) -> boolean
Returns true if the mission has generic rewards.
in_progress
🇲 Method --> ( ) -> boolean
Returns true if the mission is currently in progress.
is_complete
🇲 Method --> ( CharacterId? ) -> boolean
Returns true if the mission goal has been completed (optionally checked against given NPC ID).
reserve_random
🇫 Function --> ( MissionOrigin, Tripoint, CharacterId ) -> Mission
Reserves a random mission at the specified origin and position for the given NPC. Returns the new mission.
step_complete
🇲 Method --> ( integer )
Marks a mission step as complete, taking an integer step index.
reserve_new
🇫 Function --> ( MissionTypeIdRaw, CharacterId ) -> Mission
Reserves a new mission of the given type for the specified NPC. Returns the new mission.
assign
🇲 Method --> ( Avatar )
Assigns this mission to the given avatar.
get_likely_rewards
🇲 Method --> ( ) -> (integer, ItypeId)[]
Returns the likely rewards of the mission (vector of (int chance, itype_id) pairs).
get_npc_id
🇲 Method --> ( ) -> CharacterId
Returns the NPC character ID associated with the mission.
get_item_id
🇲 Method --> ( ) -> ItypeId
Returns the item ID associated with the mission.
get_deadline
🇲 Method --> ( ) -> TimePoint
Returns the mission's deadline as a time_point.
get_description
🇲 Method --> ( ) -> string
Returns the mission description.
has_deadline
🇲 Method --> ( ) -> boolean
Returns true if the mission has a deadline.
mission_id
🇲 Method --> ( ) -> MissionTypeIdRaw
Returns the mission type ID of this mission.
has_target
🇲 Method --> ( ) -> boolean
Returns true if the mission has a target.
get_target_point
🇲 Method --> ( ) -> Tripoint
Returns the target of the mission (pointer to tripoint_abs_omt).
get_type
🇲 Method --> ( ) -> MissionType
Returns the mission type of the target (pointer to mission_type).
get_id
🇲 Method --> ( ) -> integer
Returns the mission's unique ID.
get_follow_up
🇲 Method --> ( ) -> MissionTypeIdRaw
Returns the follow-up mission type ID.
get_value
🇲 Method --> ( ) -> integer
Returns the mission's value as an integer.
has_follow_up
🇲 Method --> ( ) -> boolean
Returns true if the mission has a follow-up mission.
MissionType
Bases
No base classes.
Constructors
- MissionType.new( )
Members
description
🇻 Variable --> CppVal<translation>
Returns the mission's description as a string.
target_npc_id
🇻 Variable --> CharacterId
Returns the ID of the target NPC for the mission, if any.
item_count
🇻 Variable --> integer
Returns the count of items involved in the mission.
empty_container
🇻 Variable --> ItypeId
Returns true if the mission requires the container to be empty.
remove_container
🇻 Variable --> boolean
Returns true if the mission requires removing a container.
monster_type
🇻 Variable --> MonsterTypeId
Returns the monster type associated with the mission, if any.
follow_up
🇻 Variable --> MissionTypeIdRaw
Returns any follow-up mission type ID.
monster_kill_goal
🇻 Variable --> integer
Returns the number of monsters required to kill for this mission.
dialogue
🇻 Variable --> table<string, CppVal<translation>>
Returns any associated dialogue for the mission.
origins
🇻 Variable --> MissionOrigin[]
Returns a list of origins from which this mission can be generated.
item_id
🇻 Variable --> ItypeId
Returns the ID of the mission's main item target, if applicable.
likely_rewards
🇻 Variable --> (integer, ItypeId)[]
Returns a vector of likely rewards (chance, itype_id pairs).
difficulty
🇻 Variable --> integer
Returns the mission's difficulty as an integer.
goal
🇻 Variable --> MissionGoal
Returns the mission's goal text.
deadline_low
🇻 Variable --> TimeDuration
Returns the minimum allowed deadline for the mission.
value
🇻 Variable --> integer
Returns the mission's reward value as an integer.
has_generic_rewards
🇻 Variable --> boolean
Returns true if the mission has generic rewards.
deadline_high
🇻 Variable --> TimeDuration
Returns the maximum allowed deadline for the mission.
urgent
🇻 Variable --> boolean
Returns true if the mission is marked as urgent.
get_all
🇫 Function --> ( ) -> MissionType[]
Returns all available missions.
get_random_mission_id
🇫 Function --> ( MissionOrigin, Tripoint ) -> MissionTypeIdRaw
Returns a random mission type ID at the specified origin and overmap tile position.
tname
🇲 Method --> ( ) -> string
MissionTypeIdRaw
Bases
No base classes.
Constructors
- MissionTypeIdRaw.new( string )
Members
No members.
ModInfoId
Bases
No base classes.
Constructors
- ModInfoId.new( )
- ModInfoId.new( ModInfoId )
- ModInfoId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> ModInfoId
obj
🇲 Method --> ( ) -> ModInfoRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
Mongroup
Bases
No base classes.
Constructors
No constructors.
Members
type
🇻 Variable --> MonsterGroupId
horde
🇻 Variable --> boolean
horde_behaviour
🇻 Variable --> string
interest
🇻 Variable --> integer
diffuse
🇻 Variable --> boolean
radius
🇻 Variable --> integer
population
🇻 Variable --> integer
clear
🇲 Method --> ( )
Remove all monsters and clear population.
is_empty
🇲 Method --> ( ) -> boolean
Check if the group has no members or population.
inc_interest
🇲 Method --> ( integer )
Increase horde interest by the given amount (clamped 15..100).
is_safe
🇲 Method --> ( ) -> boolean
Check if the group is safe.
dec_interest
🇲 Method --> ( integer )
Decrease horde interest by the given amount (clamped 15..100).
set_nemesis_target
🇲 Method --> ( Tripoint )
Set the nemesis target for this group using absolute submap coordinates.
target
🇲 Method --> ( ) -> Tripoint
Get the current target in submap coordinates relative to the overmap.
set_target
🇲 Method --> ( Tripoint )
Set the current target in submap coordinates relative to the overmap.
monsters
🇲 Method --> ( ) -> Monster[]
Get individual monster instances tracked inside the horde (if any).
nemesis_target
🇲 Method --> ( ) -> Tripoint
Get the nemesis target for this group.
pos
🇲 Method --> ( ) -> Tripoint
Get the group position in submap coordinates relative to its overmap.
set_interest
🇲 Method --> ( integer )
Set horde interest directly (clamped 15..100).
set_pos
🇲 Method --> ( Tripoint )
Set the group position in submap coordinates relative to its overmap.
avg_speed
🇲 Method --> ( ) -> number
Average movement speed of monsters in the group.
Monster
Bases
Creature
Constructors
No constructors.
Members
friendly
🇻 Variable --> integer
unique_name
🇻 Variable --> string
faction
🇻 Variable --> MonsterFactionIntId
death_drops
🇻 Variable --> boolean
morale
🇻 Variable --> integer
anger
🇻 Variable --> integer
attitude
🇲 Method --> ( Character ) -> MonsterAttitude
heal
🇲 Method --> ( integer, boolean ) -> integer
move_to
🇲 Method --> ( Tripoint, boolean, boolean, number ) -> boolean
move_target
🇲 Method --> ( ) -> Tripoint
is_wandering
🇲 Method --> ( ) -> boolean
wander_to
🇲 Method --> ( Tripoint, integer )
set_hp
🇲 Method --> ( integer )
make_fungus
🇲 Method --> ( ) -> boolean
get_items
🇲 Method --> ( ) -> Item[]
make_ally
🇲 Method --> ( Monster )
drop_items
🇲 Method --> ( Tripoint )
drop_items_here
🇲 Method --> ( )
make_friendly
🇲 Method --> ( )
clear_items
🇲 Method --> ( ) -> Detached<Item>[]
add_item
🇲 Method --> ( Item )
remove_item
🇲 Method --> ( Item ) -> Detached<Item>
swims
🇲 Method --> ( ) -> boolean
climbs
🇲 Method --> ( ) -> boolean
can_dig
🇲 Method --> ( ) -> boolean
digs
🇲 Method --> ( ) -> boolean
try_upgrade
🇲 Method --> ( boolean )
try_reproduce
🇲 Method --> ( )
refill_udders
🇲 Method --> ( )
get_upgrade_time
🇲 Method --> ( ) -> integer
can_upgrade
🇲 Method --> ( ) -> boolean
hasten_upgrade
🇲 Method --> ( )
get_type
🇲 Method --> ( ) -> MonsterTypeId
flies
🇲 Method --> ( ) -> boolean
spawn
🇲 Method --> ( Tripoint )
name_with_armor
🇲 Method --> ( ) -> string
can_climb
🇲 Method --> ( ) -> boolean
add_faction_anger
🇲 Method --> ( string, integer )
name
🇲 Method --> ( integer ) -> string
can_drown
🇲 Method --> ( ) -> boolean
can_hear
🇲 Method --> ( ) -> boolean
can_submerge
🇲 Method --> ( ) -> boolean
can_see
🇲 Method --> ( ) -> boolean
get_faction_anger
🇲 Method --> ( string ) -> integer
MonsterFactionId
Bases
No base classes.
Constructors
- MonsterFactionId.new( )
- MonsterFactionId.new( MonsterFactionId )
- MonsterFactionId.new( MonsterFactionIntId )
- MonsterFactionId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MonsterFactionId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> MonsterFactionRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> MonsterFactionIntId
MonsterFactionIntId
Bases
No base classes.
Constructors
- MonsterFactionIntId.new( )
- MonsterFactionIntId.new( MonsterFactionIntId )
- MonsterFactionIntId.new( MonsterFactionId )
Members
obj
🇲 Method --> ( ) -> MonsterFactionRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> MonsterFactionId
MonsterGroupEntry
Bases
No base classes.
Constructors
No constructors.
Members
name
🇻 Variable --> MonsterTypeId
conditions
🇻 Variable --> string[]
starts
🇻 Variable --> TimeDuration
ends
🇻 Variable --> TimeDuration
pack_maximum
🇻 Variable --> integer
cost_multiplier
🇻 Variable --> integer
pack_minimum
🇻 Variable --> integer
frequency
🇻 Variable --> integer
lasts_forever
🇲 Method --> ( ) -> boolean
MonsterGroupId
Bases
No base classes.
Constructors
- MonsterGroupId.new( )
- MonsterGroupId.new( MonsterGroupId )
- MonsterGroupId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MonsterGroupId
obj
🇲 Method --> ( ) -> MonsterGroupRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MonsterGroupRaw
Bases
No base classes.
Constructors
No constructors.
Members
name
🇻 Variable --> MonsterGroupId
new_monster_group
🇻 Variable --> MonsterGroupId
monster_group_time
🇻 Variable --> TimeDuration
is_safe
🇻 Variable --> boolean
freq_total
🇻 Variable --> integer
replace_monster_group
🇻 Variable --> boolean
monsters
🇻 Variable --> MonsterGroupEntry[]
is_animal
🇻 Variable --> boolean
defaultMonster
🇻 Variable --> MonsterTypeId
contains
🇲 Method --> ( MonsterTypeId ) -> boolean
Check if a monster type appears in this group.
MonsterTypeId
Bases
No base classes.
Constructors
- MonsterTypeId.new( )
- MonsterTypeId.new( MonsterTypeId )
- MonsterTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MonsterTypeId
obj
🇲 Method --> ( ) -> MonsterTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MonsterTypeRaw
Bases
No base classes.
Constructors
No constructors.
Members
id
🇻 Variable --> MonsterTypeId
difficulty_base
🇻 Variable --> integer
difficulty
🇻 Variable --> integer
nname
🇲 Method --> ( integer ) -> string
MoraleTypeDataId
Bases
No base classes.
Constructors
- MoraleTypeDataId.new( )
- MoraleTypeDataId.new( MoraleTypeDataId )
- MoraleTypeDataId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MoraleTypeDataId
obj
🇲 Method --> ( ) -> MoraleTypeDataRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MutationBranchId
Bases
No base classes.
Constructors
- MutationBranchId.new( )
- MutationBranchId.new( MutationBranchId )
- MutationBranchId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MutationBranchId
obj
🇲 Method --> ( ) -> MutationBranchRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
MutationBranchRaw
Bases
No base classes.
Constructors
No constructors.
Members
id
🇻 Variable --> MutationBranchId
max_stamina_modifier
🇻 Variable --> number
falling_damage_multiplier
🇻 Variable --> number
weight_capacity_modifier
🇻 Variable --> number
movecost_swim_modifier
🇻 Variable --> number
hearing_modifier
🇻 Variable --> number
noise_modifier
🇻 Variable --> number
attackcost_modifier
🇻 Variable --> number
movecost_flatground_modifier
🇻 Variable --> number
hp_adjustment
🇻 Variable --> number
Flat adjustment to HP.
movecost_obstacle_modifier
🇻 Variable --> number
str_modifier
🇻 Variable --> number
Adjustment to Strength that doesn't affect HP.
speed_modifier
🇻 Variable --> number
dodge_modifier
🇻 Variable --> number
hp_modifier_secondary
🇻 Variable --> number
Secondary HP multiplier; stacks with the other one. 1.0 doubles HP; -0.5 halves it.
scent_modifier
🇻 Variable --> number
healthy_rate
🇻 Variable --> number
How quickly health (not HP) trends toward healthy_mod.
overmap_sight
🇻 Variable --> number
stamina_regen_modifier
🇻 Variable --> number
overmap_multiplier
🇻 Variable --> number
skill_rust_multiplier
🇻 Variable --> number
reading_speed_multiplier
🇻 Variable --> number
bleed_resist
🇻 Variable --> number
fatigue_regen_modifier
🇻 Variable --> number
thirst_modifier
🇻 Variable --> number
stealth_modifier
🇻 Variable --> number
fatigue_modifier
🇻 Variable --> number
night_vision_range
🇻 Variable --> number
metabolism_modifier
🇻 Variable --> number
temperature_speed_modifier
🇻 Variable --> number
construction_speed_modifier
🇻 Variable --> number
Construction speed multiplier. 2.0 doubles construction speed; 0.5 halves it.
movecost_modifier
🇻 Variable --> number
packmule_modifier
🇻 Variable --> number
Packmule multiplier. 2.0 doubles backpack/container volume; 0.5 halves it.
crafting_speed_modifier
🇻 Variable --> number
Crafting speed multiplier. 2.0 doubles crafting speed; 0.5 halves it.
starting_trait
🇻 Variable --> boolean
Whether this trait can normally be taken during character generation.
starts_active
🇻 Variable --> boolean
Whether a mutation activates when granted.
fatigue
🇻 Variable --> boolean
Mutation causes fatigue when used.
allow_soft_gear
🇻 Variable --> boolean
Mutation allows soft gear to be worn over otherwise-restricted parts.
hunger
🇻 Variable --> boolean
Mutation deducts calories when used.
mixed_effect
🇻 Variable --> boolean
Whether this mutation has positive /and/ negative effects.
debug
🇻 Variable --> boolean
Whether or not this mutation is limited to debug use.
valid
🇻 Variable --> boolean
Whether this mutation is available through generic mutagen.
player_display
🇻 Variable --> boolean
Whether or not this mutation shows up in the status (
@) menu.
purifiable
🇻 Variable --> boolean
Whether this mutation is possible to remove through Purifier. False for 'special' mutations.
profession
🇻 Variable --> boolean
Whether this trait is ONLY gained through professional training/experience (and/or quests).
threshold
🇻 Variable --> boolean
Whether this is a Threshold mutation, and thus especially difficult to mutate. One per character.
thirst
🇻 Variable --> boolean
Mutation dehydrates when used.
activated
🇻 Variable --> boolean
Whether this mutation can be activated at will.
visibility
🇻 Variable --> integer
How visible the mutation is to others.
healing_awake
🇻 Variable --> number
Healing per turn from mutation.
pain_recovery
🇻 Variable --> number
Pain recovery per turn from mutation.
healing_resting
🇻 Variable --> number
Healing per turn from mutation, while asleep.
points
🇻 Variable --> integer
Pointcost in character creation(?).
mending_modifier
🇻 Variable --> number
Multiplier applied to broken limb regeneration. Normally 0.25; clamped to 0.25..1.0.
bodytemp_sleep_btu
🇻 Variable --> integer
hp_modifier
🇻 Variable --> number
Bonus HP multiplier. 1.0 doubles HP; -0.5 halves it.
bodytemp_min_btu
🇻 Variable --> integer
bodytemp_max_btu
🇻 Variable --> integer
cost
🇻 Variable --> integer
ugliness
🇻 Variable --> integer
How physically unappealing the mutation is. Can be negative.
cooldown
🇻 Variable --> integer
Costs are incurred every 'cooldown' turns.
thresh_requirements
🇲 Method --> ( ) -> MutationBranchId[]
Lists the threshold mutation(s) required to gain this mutation.
replaced_by
🇲 Method --> ( ) -> MutationBranchId[]
Lists mutations that replace (e.g. evolve from) this one.
mutation_types
🇲 Method --> ( ) -> string[]
Lists the type(s) of this mutation. Mutations of a given type are mutually exclusive.
conflicts_with
🇲 Method --> ( ) -> MutationBranchId[]
Lists conflicting mutations.
other_prerequisites
🇲 Method --> ( ) -> MutationBranchId[]
Lists the secondary mutation(s) needed to gain this mutation.
categories
🇲 Method --> ( ) -> MutationCategoryTraitId[]
Lists the categories this mutation belongs to.
get_all
🇫 Function --> ( ) -> MutationBranchRaw[]
Returns a (long) list of every mutation in the game.
addition_mutations
🇲 Method --> ( ) -> MutationBranchId[]
prerequisites
🇲 Method --> ( ) -> MutationBranchId[]
Lists the primary mutation(s) needed to gain this mutation.
name
🇲 Method --> ( ) -> string
desc
🇲 Method --> ( ) -> string
MutationCategoryTraitId
Bases
No base classes.
Constructors
- MutationCategoryTraitId.new( )
- MutationCategoryTraitId.new( MutationCategoryTraitId )
- MutationCategoryTraitId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> MutationCategoryTraitId
obj
🇲 Method --> ( ) -> MutationCategoryTraitRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
Npc
Bases
PlayerCharacterCreature
Constructors
No constructors.
Members
current_activity_id
🇻 Variable --> ActivityTypeId
marked_for_death
🇻 Variable --> boolean
needs
🇻 Variable --> NpcNeed[]
patience
🇻 Variable --> integer
hit_by_player
🇻 Variable --> boolean
personality
🇻 Variable --> NpcPersonality
op_of_u
🇻 Variable --> NpcOpinion
get_first_topic
🇲 Method --> ( ) -> string
Returns the first topic of the npc's chatbin.
set_first_topic
🇲 Method --> ( string )
Sets the first topic of the npc's chatbin. Note that some circumstances may cause this to not be the first topic used, such as player allies.
npc_menu
🇲 Method --> ( boolean? )
Triggers the npc menu to open.
smash_ability
🇲 Method --> ( ) -> integer
Gets the npc's blunt damage with their currently equipped weapon.
current_target
🇲 Method --> ( ) -> Creature
Returns the npc's current target as a creature, if it has one.
current_ally
🇲 Method --> ( ) -> Creature
Returns the npc's current ally, if it has one.
danger_assessment
🇲 Method --> ( ) -> number
Gets a value based on the npc's perspective of the area's danger.
follow_distance
🇲 Method --> ( ) -> integer
Gets the npc's follow distance. This can only be a few values, and is determined by npc rules.
talk_to_u
🇲 Method --> ( string?, boolean? )
Causes the npc to talk to you. Passing a topic will force that topic to be used in place of all others, including code enforced topics such as 'TALK_STOLE_ITEM'.
say
🇲 Method --> ( string )
Has the npc say the given string in the sidebar.
complain
🇲 Method --> ( ) -> boolean
Finds something to complain about and complains. Returns if complained.
warn_about
🇲 Method --> ( string, TimeDuration, string, integer, Tripoint )
Wrapper for complain_about that warns about a specific type of threat, with different warnings for hostile or friendly NPCs and hostile NPCs always complaining.
saw_player_recently
🇲 Method --> ( ) -> boolean
has_omt_destination
🇲 Method --> ( ) -> boolean
get_attitude
🇲 Method --> ( ) -> NpcAttitude
complain_about
🇲 Method --> ( string, TimeDuration, string, boolean? ) -> boolean
Complain about an issue if enough time has passed. The first string is the issue identifier, with the second being the complaint text. The optional bool allows you to force a complaint without concern for the input time.
can_move_to
🇲 Method --> ( Tripoint, boolean ) -> boolean
evaluate_enemy
🇲 Method --> ( Creature ) -> number
Rates how dangerous a target is from 0 (harmless) to 1 (max danger).
can_open_door
🇲 Method --> ( Tripoint, boolean ) -> boolean
get_monster_faction
🇲 Method --> ( ) -> MonsterFactionIntId
Returns the npc's faction id. If it's part of a monster faction, it returns the id of the monster faction.
mutiny
🇲 Method --> ( )
Causes the npc to leave your faction, incur various negative opinion maluses, and say explatives to the player.
is_travelling
🇲 Method --> ( ) -> boolean
Returns true if the npc has the 'NPC_MISSION_TRAVELLING' mission.
is_minion
🇲 Method --> ( ) -> boolean
Returns true if the npc is a player ally and their op_of_u.trust is >= 5.
make_angry
🇲 Method --> ( )
is_enemy
🇲 Method --> ( ) -> boolean
is_following
🇲 Method --> ( ) -> boolean
is_obeying
🇲 Method --> ( Character ) -> boolean
hostile_anger_level
🇲 Method --> ( ) -> integer
is_simulated
🇲 Method --> ( ) -> boolean
True if this NPC is in a simulated (fully loaded, AI-eligible) submap.
turned_hostile
🇲 Method --> ( ) -> boolean
set_faction_id
🇲 Method --> ( FactionId )
guaranteed_hostile
🇲 Method --> ( ) -> boolean
Returns true if the npc would be hostile to the player on sight regardless of their current attitude.
is_friendly
🇲 Method --> ( Character ) -> boolean
is_walking_with
🇲 Method --> ( ) -> boolean
is_patrolling
🇲 Method --> ( ) -> boolean
has_player_activity
🇲 Method --> ( ) -> boolean
set_attitude
🇲 Method --> ( NpcAttitude )
is_leader
🇲 Method --> ( ) -> boolean
is_guarding
🇲 Method --> ( ) -> boolean
is_player_ally
🇲 Method --> ( ) -> boolean
is_stationary
🇲 Method --> ( boolean ) -> boolean
is_ally
🇲 Method --> ( Character ) -> boolean
has_activity
🇲 Method --> ( ) -> boolean
NpcOpinion
Bases
No base classes.
Constructors
- NpcOpinion.new( )
- NpcOpinion.new( int, int, int, int, int )
Members
trust
🇻 Variable --> integer
anger
🇻 Variable --> integer
value
🇻 Variable --> integer
fear
🇻 Variable --> integer
owed
🇻 Variable --> integer
NpcPersonality
Bases
No base classes.
Constructors
- NpcPersonality.new( )
Members
aggression
🇻 Variable --> integer
collector
🇻 Variable --> integer
bravery
🇻 Variable --> integer
altruism
🇻 Variable --> integer
OmtFindParams
Bases
No base classes.
Constructors
- OmtFindParams.new( )
Members
types
🇻 Variable --> (string, OtMatchType)[]
Vector of (terrain_type, match_type) pairs to search for.
max_results
🇻 Variable --> integer?
If set, limits the number of results returned.
explored
🇻 Variable --> boolean?
If set, filters by terrain explored status (true = explored only, false = unexplored only).
existing_only
🇻 Variable --> boolean
If true, restricts search to existing overmaps only.
exclude_types
🇻 Variable --> (string, OtMatchType)[]
Vector of (terrain_type, match_type) pairs to exclude from search.
seen
🇻 Variable --> boolean?
If set, filters by terrain seen status (true = seen only, false = unseen only).
set_search_range
🇲 Method --> ( integer, integer )
Set the search range in overmap tiles (min, max).
add_exclude_type
🇲 Method --> ( string, OtMatchType )
Helper method to add a terrain type to exclude from search.
add_type
🇲 Method --> ( string, OtMatchType )
Helper method to add a terrain type to search for.
set_search_layers
🇲 Method --> ( integer, integer )
Set the search layer range (z-levels).
OterId
Bases
No base classes.
Constructors
Members
NULL_ID
🇫 Function --> ( ) -> OterId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> OterRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> OterIntId
OterIntId
Bases
No base classes.
Constructors
Members
obj
🇲 Method --> ( ) -> OterRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> OterId
OvermapBuffer
Global overmap buffer that manages all overmap data
Bases
No base classes.
Constructors
No constructors.
Members
electric_grid_at
🇲 Method --> ( Tripoint ) -> Tripoint[]
Get all overmap tiles belonging to the electric grid at the given position
add_grid_connection
🇲 Method --> ( Tripoint, Tripoint ) -> boolean
Add an electric grid connection between two positions
electric_grid_connectivity_at
🇲 Method --> ( Tripoint ) -> Tripoint[]
Get all electric grid connections from the given position
remove_grid_connection
🇲 Method --> ( Tripoint, Tripoint ) -> boolean
Remove an electric grid connection between two positions
Player
Bases
CharacterCreature
Constructors
No constructors.
Members
No members.
Point
Bases
No base classes.
Constructors
- Point.new( )
- Point.new( Point )
- Point.new( int, int )
Members
x
🇻 Variable --> integer
y
🇻 Variable --> integer
abs
🇲 Method --> ( ) -> Point
rotate
🇲 Method --> ( integer, Point ) -> Point
PopupInputStr
Bases
No base classes.
Constructors
- PopupInputStr.new( )
Members
title
🇲 Method --> ( string )
titleis on the left of input field.
query_str
🇲 Method --> ( ) -> string
Returns your input.
desc
🇲 Method --> ( string )
descis above input field.
query_int
🇲 Method --> ( ) -> integer
Returns your input, but allows numbers only.
PowerStat
Power generation and consumption statistics for a grid
Bases
No base classes.
Constructors
No constructors.
Members
gen_w
🇻 Variable --> integer
Power generation in watts
use_w
🇻 Variable --> integer
Power consumption in watts
net_w
🇲 Method --> ( ) -> integer
Net power (generation - consumption) in watts
QualityId
Bases
No base classes.
Constructors
- QualityId.new( )
- QualityId.new( QualityId )
- QualityId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> QualityId
obj
🇲 Method --> ( ) -> QualityRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
QueryPopup
Bases
No base classes.
Constructors
- QueryPopup.new( )
Members
message
🇲 Method --> ( any )
query
🇲 Method --> ( ) -> string
Returns selected action
query_yn
🇲 Method --> ( ) -> string
Returns
YESorNO. If ESC pressed, returnsNO.
allow_any_key
🇲 Method --> ( boolean )
Set whether to allow any key
message_color
🇲 Method --> ( Color )
query_ynq
🇲 Method --> ( ) -> string
Returns
YES,NOorQUIT. If ESC pressed, returnsQUIT.
RangedData
Bases
No base classes.
Constructors
No constructors.
Members
aimed_crit_bonus
🇻 Variable --> number
dispersion
🇻 Variable --> integer
range
🇻 Variable --> integer
damage
🇻 Variable --> DamageInstance
aimed_crit_max_bonus
🇻 Variable --> number
speed
🇻 Variable --> integer
RecipeId
Bases
No base classes.
Constructors
- RecipeId.new( )
- RecipeId.new( RecipeId )
- RecipeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> RecipeId
obj
🇲 Method --> ( ) -> RecipeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
RecipeRaw
Bases
No base classes.
Constructors
No constructors.
Members
category
🇻 Variable --> string
required_skills
🇻 Variable --> table<SkillId, integer>
learn_by_disassembly
🇻 Variable --> table<SkillId, integer>
difficulty
🇻 Variable --> integer
booksets
🇻 Variable --> table<ItypeId, integer>
time
🇻 Variable --> integer
subcategory
🇻 Variable --> string
skill_used
🇻 Variable --> SkillId
has_flag
🇲 Method --> ( string ) -> boolean
result_name
🇲 Method --> ( boolean ) -> string
get_from_skill_used
🇫 Function --> ( SkillId ) -> RecipeRaw[]
result
🇲 Method --> ( ) -> ItypeId
recipe_id
🇲 Method --> ( ) -> RecipeId
get_from_flag
🇫 Function --> ( string ) -> RecipeRaw[]
get_all
🇫 Function --> ( ) -> RecipeRaw[]
Relic
Bases
No base classes.
Constructors
No constructors.
Members
name
🇲 Method --> ( ) -> string
get_recharge_scheme
🇲 Method --> ( ) -> CppVal<relic_recharge>[]
get_enchantments
🇲 Method --> ( ) -> CppVal<enchantment>[]
get_spells
🇲 Method --> ( ) -> SpellSimple[]
RequirementData
Represents crafting requirements (tools, components, qualities)
Bases
No base classes.
Constructors
No constructors.
Members
id
🇲 Method --> ( ) -> string
Get the requirement ID as string
list_all
🇲 Method --> ( ) -> string
Get a formatted list of all requirements
list_missing
🇲 Method --> ( ) -> string
Get a formatted list of missing requirements
can_make_with_inventory
🇲 Method --> ( Inventory ) -> boolean
Check if requirements can be made with given inventory
get_components
🇲 Method --> ( ) -> CppVal<item_comp>[][]
Get list of all required components
get_qualities
🇲 Method --> ( ) -> CppVal<quality_requirement>[][]
Get list of all required qualities
get_tools
🇲 Method --> ( ) -> CppVal<tool_comp>[][]
Get list of all required tools
is_null
🇲 Method --> ( ) -> boolean
Check if this is a null requirement
is_empty
🇲 Method --> ( ) -> boolean
Check if this requirement is empty
is_blacklisted
🇲 Method --> ( ) -> boolean
Check if this requirement is blacklisted
Resistances
Bases
No base classes.
Constructors
No constructors.
Members
get_all_resist
🇲 Method --> ( ) -> table<DamageType, number>
get_resist
🇲 Method --> ( DamageType ) -> number
get_effective_resist
🇲 Method --> ( DamageUnit ) -> number
SkillId
Bases
No base classes.
Constructors
- SkillId.new( )
- SkillId.new( SkillId )
- SkillId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> SkillId
obj
🇲 Method --> ( ) -> SkillRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
SkillLevel
Bases
No base classes.
Constructors
No constructors.
Members
is_training
🇲 Method --> ( ) -> boolean
train
🇲 Method --> ( integer, boolean )
highest_level
🇲 Method --> ( ) -> integer
level
🇲 Method --> ( ) -> integer
can_train
🇲 Method --> ( ) -> boolean
SkillLevelMap
Bases
Dict( SkillId, SkillLevel )
Constructors
No constructors.
Members
mod_skill_level
🇲 Method --> ( SkillId, integer )
get_skill_level
🇲 Method --> ( SkillId ) -> integer
get_skill_level_object
🇲 Method --> ( SkillId ) -> SkillLevel
SpeciesTypeId
Bases
No base classes.
Constructors
- SpeciesTypeId.new( )
- SpeciesTypeId.new( SpeciesTypeId )
- SpeciesTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> SpeciesTypeId
obj
🇲 Method --> ( ) -> SpeciesTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
Spell
The class used for spells that a player knows, casts, and gains experience for using. If a given spell is not supposed to be directly cast by a player, consider using
SpellSimpleinstead.
Bases
No base classes.
Constructors
- Spell.new( SpellTypeId, int )
Members
id
🇻 Variable --> SpellTypeId
get_level
🇲 Method --> ( ) -> integer
name
🇲 Method --> ( ) -> string
desc
🇲 Method --> ( ) -> string
cast
🇲 Method --> ( Creature, Tripoint )
Cast this spell, as well as any sub-spells.
set_level
🇲 Method --> ( integer )
set_exp
🇲 Method --> ( integer )
gain_levels
🇲 Method --> ( integer )
xp
🇲 Method --> ( ) -> integer
gain_exp
🇲 Method --> ( integer )
cast_single_effect
🇲 Method --> ( Creature, Tripoint )
Cast only this spell's main effects. Generally, cast() should be used instead.
SpellSimple
The type for basic spells. If you don't need to track XP from casting (e.g., if a spell is intended to be cast by anything other than a player), this is likely the appropriate type. Otherwise, see the
Spelltype.
Bases
No base classes.
Constructors
- SpellSimple.new( SpellTypeId, bool )
- SpellSimple.new( SpellTypeId, bool, int )
Members
level
🇻 Variable --> integer
trigger_once_in
🇻 Variable --> integer
Used for enchantments; the spell's chance to trigger every turn.
id
🇻 Variable --> SpellTypeId
force_target_source
🇻 Variable --> boolean
Whether or not the target point is locked to the source's location.
prompt_cast
🇫 Function --> ( SpellTypeId, Tripoint, integer? ) -> SpellSimple
Static function: Creates and immediately casts a SimpleSpell, then returns the new spell for potential reuse. If the given tripoint is the player's location, the spell will be locked to the player. (This does not necessarily cause friendly fire!) If an integer is specified, the spell will be cast at that level.
max_level
🇲 Method --> ( ) -> integer
Returns the defined maximum level of this
SpellSimpleinstance, if defined. Otherwise, returns 0.
cast
🇲 Method --> ( Creature, Tripoint, integer? )
SpellTypeId
Bases
No base classes.
Constructors
- SpellTypeId.new( )
- SpellTypeId.new( SpellTypeId )
- SpellTypeId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> SpellTypeId
obj
🇲 Method --> ( ) -> SpellTypeRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
SpellTypeRaw
The 'raw' type for storing the information defining every spell in the game. It's not possible to cast directly from this type; check
SpellSimpleandSpell.
Bases
No base classes.
Constructors
No constructors.
Members
aoe_increment
🇻 Variable --> number
max_dot
🇻 Variable --> integer
min_duration
🇻 Variable --> integer
dot_increment
🇻 Variable --> number
max_aoe
🇻 Variable --> integer
min_dot
🇻 Variable --> integer
final_casting_time
🇻 Variable --> integer
duration_increment
🇻 Variable --> integer
base_energy_cost
🇻 Variable --> integer
max_level
🇻 Variable --> integer
max_duration
🇻 Variable --> integer
difficulty
🇻 Variable --> integer
energy_increment
🇻 Variable --> number
final_energy_cost
🇻 Variable --> integer
base_casting_time
🇻 Variable --> integer
min_aoe
🇻 Variable --> integer
range_increment
🇻 Variable --> number
field_chance
🇻 Variable --> integer
min_field_intensity
🇻 Variable --> integer
effect_str
🇻 Variable --> string
Specifics about the effect this spell will enact.
id
🇻 Variable --> SpellTypeId
effect_name
🇻 Variable --> string
The name of the primary effect this spell will enact.
max_range
🇻 Variable --> integer
field_intensity_increment
🇻 Variable --> number
field_intensity_variance
🇻 Variable --> number
min_range
🇻 Variable --> integer
max_field_intensity
🇻 Variable --> integer
max_damage
🇻 Variable --> integer
min_damage
🇻 Variable --> integer
damage_increment
🇻 Variable --> number
casting_time_increment
🇻 Variable --> number
get_all
🇫 Function --> ( ) -> SpellTypeRaw[]
Returns a (long) list of every spell in the game.
additional_spells
🇲 Method --> ( ) -> SpellSimple[]
Other spells cast by this spell.
TerId
Bases
No base classes.
Constructors
Members
NULL_ID
🇫 Function --> ( ) -> TerId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> TerRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> TerIntId
TerIntId
Bases
No base classes.
Constructors
Members
obj
🇲 Method --> ( ) -> TerRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> TerId
TerRaw
Bases
No base classes.
Constructors
No constructors.
Members
heat_radiation
🇻 Variable --> integer
close
🇻 Variable --> TerId
trap_id_str
🇻 Variable --> string
open
🇻 Variable --> TerId
roof
🇻 Variable --> TerId
transforms_into
🇻 Variable --> TerId
set_coverage
🇲 Method --> ( integer )
get_max_volume
🇲 Method --> ( ) -> Volume
set_max_volume
🇲 Method --> ( Volume )
get_coverage
🇲 Method --> ( ) -> integer
set_movecost
🇲 Method --> ( integer )
set_light_emitted
🇲 Method --> ( integer )
name
🇲 Method --> ( ) -> string
int_id
🇲 Method --> ( ) -> TerIntId
get_movecost
🇲 Method --> ( ) -> integer
get_flags
🇲 Method --> ( ) -> string[]
set_flag
🇲 Method --> ( string )
has_flag
🇲 Method --> ( string ) -> boolean
get_light_emitted
🇲 Method --> ( ) -> integer
str_id
🇲 Method --> ( ) -> TerId
TimeDuration
Represent duration between 2 fixed points in time
Bases
No base classes.
Constructors
- TimeDuration.new( )
Members
from_turns
🇫 Function --> ( integer ) -> TimeDuration
to_seconds
🇲 Method --> ( ) -> integer
to_turns
🇲 Method --> ( ) -> integer
to_minutes
🇲 Method --> ( ) -> integer
to_weeks
🇲 Method --> ( ) -> integer
to_days
🇲 Method --> ( ) -> integer
make_random
🇲 Method --> ( TimeDuration ) -> TimeDuration
to_hours
🇲 Method --> ( ) -> integer
from_days
🇫 Function --> ( integer ) -> TimeDuration
from_minutes
🇫 Function --> ( integer ) -> TimeDuration
from_seconds
🇫 Function --> ( integer ) -> TimeDuration
from_weeks
🇫 Function --> ( integer ) -> TimeDuration
from_hours
🇫 Function --> ( integer ) -> TimeDuration
TimePoint
Library for dealing with time primitives.
Represent fixed point in time
Bases
No base classes.
Constructors
- TimePoint.new( )
Members
from_turn
🇫 Function --> ( integer ) -> TimePoint
season
🇲 Method --> ( ) -> string
moon_phase
🇲 Method --> ( ) -> MoonPhase
minute_of_hour
🇲 Method --> ( ) -> integer
to_string_time_of_day
🇲 Method --> ( ) -> string
hour_of_day
🇲 Method --> ( ) -> integer
sunset
🇲 Method --> ( ) -> TimePoint
second_of_minute
🇲 Method --> ( ) -> integer
is_dawn
🇲 Method --> ( ) -> boolean
is_night
🇲 Method --> ( ) -> boolean
to_turn
🇲 Method --> ( ) -> integer
is_day
🇲 Method --> ( ) -> boolean
is_dusk
🇲 Method --> ( ) -> boolean
sunrise
🇲 Method --> ( ) -> TimePoint
Tinymap
Bases
Map
Constructors
No constructors.
Members
No members.
TrapId
Bases
No base classes.
Constructors
Members
NULL_ID
🇫 Function --> ( ) -> TrapId
str
🇲 Method --> ( ) -> string
obj
🇲 Method --> ( ) -> TrapRaw
is_null
🇲 Method --> ( ) -> boolean
is_valid
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
int_id
🇲 Method --> ( ) -> TrapIntId
TrapIntId
Bases
No base classes.
Constructors
Members
obj
🇲 Method --> ( ) -> TrapRaw
is_valid
🇲 Method --> ( ) -> boolean
str_id
🇲 Method --> ( ) -> TrapId
Tripoint
Bases
No base classes.
Constructors
Members
x
🇻 Variable --> integer
z
🇻 Variable --> integer
y
🇻 Variable --> integer
xy
🇲 Method --> ( ) -> Point
rotate_2d
🇲 Method --> ( integer, Point ) -> Tripoint
abs
🇲 Method --> ( ) -> Tripoint
UiList
Bases
No base classes.
Constructors
- UiList.new( )
Members
entries
🇻 Variable --> UiListEntry[]
Entries from uilist. Remember, in lua, the first element of vector is
entries[1], notentries[0].
border_color
🇲 Method --> ( Color )
Changes the color. Default color is
c_magenta.
title
🇲 Method --> ( string )
Sets title which is on the top line.
text_color
🇲 Method --> ( Color )
Changes the color. Default color is
c_light_gray.
hilight_color
🇲 Method --> ( Color )
Changes the color. Default color is
h_white.
title_color
🇲 Method --> ( Color )
Changes the color. Default color is
c_green.
hotkey_color
🇲 Method --> ( Color )
Changes the color. Default color is
c_light_green.
add_w_col
🇲 Method --> ( integer, string, string, string )
Adds an entry with desc and col(third
string). col is additional text on the right of the entry name.
add
🇲 Method --> ( integer, string )
Adds an entry.
stringis its name, andintis what it returns. Ifintis-1, the number is decided orderly.
text
🇲 Method --> ( string )
Sets text which is in upper box.
add_w_desc
🇲 Method --> ( integer, string, string )
Adds an entry with desc(second
string).desc_enabled(true)is required for showing desc.
footer
🇲 Method --> ( string )
Sets footer text which is in lower box. It overwrites descs of entries unless is empty.
desc_enabled
🇲 Method --> ( boolean )
Puts a lower box. Footer or entry desc appears on it.
query
🇲 Method --> ( ) -> integer
Returns retval for selected entry, or a negative number on fail/cancel
UiListEntry
This type came from
UiList.
Bases
No base classes.
Constructors
No constructors.
Members
enable
🇻 Variable --> boolean
Entry whether it's enabled or not. Default is
true.
ctxt
🇻 Variable --> string
Entry text of column.
desc
🇻 Variable --> string
Entry description
txt
🇻 Variable --> string
Entry text
txt_color
🇲 Method --> ( Color )
Entry text color. Its default color is
c_red_red, which makes color of the entry same as whatuilistdecides. So if you want to make color different, choose one exceptc_red_red.
VitaminId
Bases
No base classes.
Constructors
- VitaminId.new( )
- VitaminId.new( VitaminId )
- VitaminId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> VitaminId
obj
🇲 Method --> ( ) -> VitaminRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
VitaminRaw
Bases
No base classes.
Constructors
No constructors.
Members
deficiency
🇲 Method --> ( ) -> EffectTypeId
severity
🇲 Method --> ( integer ) -> integer
name
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
vitamin_id
🇲 Method --> ( ) -> VitaminId
rate
🇲 Method --> ( ) -> TimeDuration
min
🇲 Method --> ( ) -> integer
max
🇲 Method --> ( ) -> integer
excess
🇲 Method --> ( ) -> EffectTypeId
has_flag
🇲 Method --> ( string ) -> boolean
vitamin_type
🇲 Method --> ( ) -> VitaminType
Volume
Bases
No base classes.
Constructors
No constructors.
Members
from_milliliter
🇫 Function --> ( integer ) -> Volume
to_milliliter
🇲 Method --> ( ) -> integer
to_liter
🇲 Method --> ( ) -> number
from_liter
🇫 Function --> ( integer ) -> Volume
WeaponCategoryId
Bases
No base classes.
Constructors
- WeaponCategoryId.new( )
- WeaponCategoryId.new( WeaponCategoryId )
- WeaponCategoryId.new( string )
Members
NULL_ID
🇫 Function --> ( ) -> WeaponCategoryId
obj
🇲 Method --> ( ) -> WeaponCategoryRaw
is_valid
🇲 Method --> ( ) -> boolean
str
🇲 Method --> ( ) -> string
is_null
🇲 Method --> ( ) -> boolean
implements_int_id
🇫 Function --> ( ) -> boolean
WrappedVehicle
Bases
No base classes.
Constructors
No constructors.
Members
pos
🇲 Method --> ( ) -> Tripoint
Returns the vehicle origin tile in local map-square coordinates.
type
🇲 Method --> ( ) -> string
Returns the vehicle prototype id string.
Enums
AddictionType
Entries
NONE=0CAFFEINE=1ALCOHOL=2SLEEP=3PKILLER=4SPEED=5CIG=6COKE=7CRACK=8MUTAGEN=9DIAZEPAM=10MARLOSS_R=11MARLOSS_B=12MARLOSS_Y=13
ArtifactCharge
Entries
ARTC_NULL=0ARTC_TIME=1ARTC_SOLAR=2ARTC_PAIN=3ARTC_HP=4ARTC_FATIGUE=5ARTC_PORTAL=6
ArtifactChargeReq
Entries
ACR_NULL=0ACR_EQUIP=1ACR_SKIN=2ACR_SLEEP=3ACR_RAD=4ACR_WET=5ACR_SKY=6
ArtifactEffectActive
Entries
AEP_NULL=0AEP_STR_UP=1AEP_DEX_UP=2AEP_PER_UP=3AEP_INT_UP=4AEP_ALL_UP=5AEP_SPEED_UP=6AEP_PBLUE=7AEP_SNAKES=8AEP_INVISIBLE=9AEP_CLAIRVOYANCE=10AEP_SUPER_CLAIRVOYANCE=11AEP_STEALTH=12AEP_EXTINGUISH=13AEP_GLOW=14AEP_PSYSHIELD=15AEP_RESIST_ELECTRICITY=16AEP_CARRY_MORE=17AEP_SAP_LIFE=18AEP_FUN=19AEP_SPLIT=20AEP_HUNGER=21AEP_THIRST=22AEP_SMOKE=23AEP_EVIL=24AEP_SCHIZO=25AEP_RADIOACTIVE=26AEP_MUTAGENIC=27AEP_ATTENTION=28AEP_STR_DOWN=29AEP_DEX_DOWN=30AEP_PER_DOWN=31AEP_INT_DOWN=32AEP_ALL_DOWN=33AEP_SPEED_DOWN=34AEP_FORCE_TELEPORT=35AEP_MOVEMENT_NOISE=36AEP_BAD_WEATHER=37AEP_SICK=38AEP_CLAIRVOYANCE_PLUS=39
ArtifactEffectPassive
Entries
AEA_NULL=0AEA_STORM=1AEA_FIREBALL=2AEA_ADRENALINE=3AEA_MAP=4AEA_BLOOD=5AEA_FATIGUE=6AEA_ACIDBALL=7AEA_PULSE=8AEA_HEAL=9AEA_CONFUSED=10AEA_ENTRANCE=11AEA_BUGS=12AEA_TELEPORT=13AEA_LIGHT=14AEA_GROWTH=15AEA_HURTALL=16AEA_FUN=17AEA_SPLIT=18AEA_RADIATION=19AEA_PAIN=20AEA_MUTATE=21AEA_PARALYZE=22AEA_FIRESTORM=23AEA_ATTENTION=24AEA_TELEGLOW=25AEA_NOISE=26AEA_SCREAM=27AEA_DIM=28AEA_FLASH=29AEA_VOMIT=30AEA_SHADOWS=31AEA_STAMINA_EMPTY=32
Attitude
Entries
Hostile=0Neutral=1Friendly=2Any=3
BodyPart
Entries
TORSO=0HEAD=1EYES=2MOUTH=3ARM_L=4ARM_R=5HAND_L=6HAND_R=7LEG_L=8LEG_R=9FOOT_L=10FOOT_R=11
CharacterMoveMode
Entries
walk=0run=1crouch=2
Color
Entries
c_black=0c_white=1c_light_gray=2c_dark_gray=3c_red=4c_green=5c_blue=6c_cyan=7c_magenta=8c_brown=9c_light_red=10c_light_green=11c_light_blue=12c_light_cyan=13c_pink=14c_yellow=15h_black=16h_white=17h_light_gray=18h_dark_gray=19h_red=20h_green=21h_blue=22h_cyan=23h_magenta=24h_brown=25h_light_red=26h_light_green=27h_light_blue=28h_light_cyan=29h_pink=30h_yellow=31i_black=32i_white=33i_light_gray=34i_dark_gray=35i_red=36i_green=37i_blue=38i_cyan=39i_magenta=40i_brown=41i_light_red=42i_light_green=43i_light_blue=44i_light_cyan=45i_pink=46i_yellow=47c_unset=48c_black_red=49c_white_red=50c_light_gray_red=51c_dark_gray_red=52c_red_red=53c_green_red=54c_blue_red=55c_cyan_red=56c_magenta_red=57c_brown_red=58c_light_red_red=59c_light_green_red=60c_light_blue_red=61c_light_cyan_red=62c_pink_red=63c_yellow_red=64c_black_white=65c_dark_gray_white=66c_light_gray_white=67c_white_white=68c_red_white=69c_light_red_white=70c_green_white=71c_light_green_white=72c_brown_white=73c_yellow_white=74c_blue_white=75c_light_blue_white=76c_magenta_white=77c_pink_white=78c_cyan_white=79c_light_cyan_white=80c_black_green=81c_dark_gray_green=82c_light_gray_green=83c_white_green=84c_red_green=85c_light_red_green=86c_green_green=87c_light_green_green=88c_brown_green=89c_yellow_green=90c_blue_green=91c_light_blue_green=92c_magenta_green=93c_pink_green=94c_cyan_green=95c_light_cyan_green=96c_black_yellow=97c_dark_gray_yellow=98c_light_gray_yellow=99c_white_yellow=100c_red_yellow=101c_light_red_yellow=102c_green_yellow=103c_light_green_yellow=104c_brown_yellow=105c_yellow_yellow=106c_blue_yellow=107c_light_blue_yellow=108c_magenta_yellow=109c_pink_yellow=110c_cyan_yellow=111c_light_cyan_yellow=112c_black_magenta=113c_dark_gray_magenta=114c_light_gray_magenta=115c_white_magenta=116c_red_magenta=117c_light_red_magenta=118c_green_magenta=119c_light_green_magenta=120c_brown_magenta=121c_yellow_magenta=122c_blue_magenta=123c_light_blue_magenta=124c_magenta_magenta=125c_pink_magenta=126c_cyan_magenta=127c_light_cyan_magenta=128c_black_cyan=129c_dark_gray_cyan=130c_light_gray_cyan=131c_white_cyan=132c_red_cyan=133c_light_red_cyan=134c_green_cyan=135c_light_green_cyan=136c_brown_cyan=137c_yellow_cyan=138c_blue_cyan=139c_light_blue_cyan=140c_magenta_cyan=141c_pink_cyan=142c_cyan_cyan=143c_light_cyan_cyan=144
DamageType
Entries
DT_NULL=0DT_TRUE=1DT_BIOLOGICAL=2DT_BASH=3DT_CUT=4DT_ACID=5DT_STAB=6DT_HEAT=7DT_COLD=8DT_DARK=9DT_LIGHT=10DT_PSI=11DT_ELECTRIC=12DT_BULLET=13
MissionGoal
Entries
MGOAL_NULL=0MGOAL_GO_TO=1MGOAL_GO_TO_TYPE=2MGOAL_FIND_ITEM=3MGOAL_FIND_ANY_ITEM=4MGOAL_FIND_ITEM_GROUP=5MGOAL_FIND_MONSTER=6MGOAL_FIND_NPC=7MGOAL_ASSASSINATE=8MGOAL_KILL_MONSTER=9MGOAL_KILL_MONSTER_TYPE=10MGOAL_KILL_NEMESIS=11MGOAL_RECRUIT_NPC=12MGOAL_RECRUIT_NPC_CLASS=13MGOAL_COMPUTER_TOGGLE=14MGOAL_KILL_MONSTER_SPEC=15MGOAL_TALK_TO_NPC=16MGOAL_CONDITION=17MGOAL_KILL_MONSTERS=18
MissionOrigin
Entries
ORIGIN_NULL=0ORIGIN_GAME_START=1ORIGIN_OPENER_NPC=2ORIGIN_ANY_NPC=3ORIGIN_SECONDARY=4ORIGIN_COMPUTER=5
MonsterAttitude
Entries
MATT_NULL=0MATT_FRIEND=1MATT_FPASSIVE=2MATT_FLEE=3MATT_IGNORE=4MATT_FOLLOW=5MATT_ATTACK=6MATT_ZLAVE=7MATT_UNKNOWN=8
MonsterFactionAttitude
Entries
ByMood=0Neutral=1Friendly=2Hate=3
MonsterFlag
Entries
SEES=0HEARS=1GOODHEARING=2SMELLS=3KEENNOSE=4STUMBLES=5WARM=6NEMESIS=7NOHEAD=8HARDTOSHOOT=9GRABS=10BASHES=11DESTROYS=12BORES=13POISON=14VENOM=15BADVENOM=16PARALYZEVENOM=17BLEED=18WEBWALK=19DIGS=20CAN_DIG=21FLIES=22AQUATIC=23SWIMS=24ATTACKMON=25ANIMAL=26PLASTIC=27SUNDEATH=28ELECTRIC=29ACIDPROOF=30ACIDTRAIL=31SHORTACIDTRAIL=32FIREPROOF=33SLUDGEPROOF=34SLUDGETRAIL=35COLDPROOF=36BIOPROOF=37DARKPROOF=38LIGHTPROOF=39PSIPROOF=40FIREY=41QUEEN=42ELECTRONIC=43FUR=44LEATHER=45WOOL=46FEATHER=47BONES=48FAT=49CONSOLE_DESPAWN=50IMMOBILE=51STATIONARY=52ID_CARD_DESPAWN=53RIDEABLE_MECH=54CARD_OVERRIDE=55MILITARY_MECH=56MECH_RECON_VISION=57MECH_DEFENSIVE=58HIT_AND_RUN=59GUILT=60PAY_BOT=61HUMAN=62NO_BREATHE=63FLAMMABLE=64REVIVES=65CHITIN=66VERMIN=67NOGIB=68LARVA=69ARTHROPOD_BLOOD=70ACID_BLOOD=71BILE_BLOOD=72ABSORBS=73ABSORBS_SPLITS=74CBM_CIV=75CBM_POWER=76CBM_SCI=77CBM_OP=78CBM_TECH=79CBM_SUBS=80UNUSED_76=81FISHABLE=82GROUP_BASH=83SWARMS=84GROUP_MORALE=85INTERIOR_AMMO=86CLIMBS=87PACIFIST=88PUSH_MON=89PUSH_VEH=90NIGHT_INVISIBILITY=91REVIVES_HEALTHY=92NO_NECRO=93PATH_AVOID_DANGER_1=94PATH_AVOID_DANGER_2=95PATH_AVOID_FIRE=96PATH_AVOID_FALL=97PRIORITIZE_TARGETS=98NOT_HALLUCINATION=99CANPLAY=100PET_MOUNTABLE=101PET_HARNESSABLE=102DOGFOOD=103MILKABLE=104SHEARABLE=105NO_BREED=106NO_FUNG_DMG=107PET_WONT_FOLLOW=108DRIPS_NAPALM=109DRIPS_GASOLINE=110ELECTRIC_FIELD=111LOUDMOVES=112CAN_OPEN_DOORS=113STUN_IMMUNE=114DROPS_AMMO=115CAN_BE_ORDERED=116SMALL_HEAD=117TINY_HEAD=118NO_HEAD_BONUS_CRIT=119HEAD_BONUS_CRIT_1=120HEAD_BONUS_CRIT_2=121TORSO_BONUS_CRIT_1=122TORSO_BONUS_CRIT_2=123PROJECTILE_RESISTANT_1=124PROJECTILE_RESISTANT_2=125PROJECTILE_RESISTANT_3=126PROJECTILE_RESISTANT_4=127VOLATILE=128CANT_CLONE=129MOUNTABLE_STAIRS=130MOUNTABLE_LADDER=131MOUNTABLE_OBSTACLES=132MOUNTABLE_DOORS=133MOUNTABLE_LEDGE=134FACTION_MEMORY=135COMBAT_MOUNT=136CANT_TRAIN=137
MonsterSize
Entries
TINY=0SMALL=1MEDIUM=2LARGE=3HUGE=4
MoonPhase
Entries
MOON_NEW=0MOON_WAXING_CRESCENT=1MOON_HALF_MOON_WAXING=2MOON_WAXING_GIBBOUS=3MOON_FULL=4MOON_WANING_GIBBOUS=5MOON_HALF_MOON_WANING=6MOON_WANING_CRESCENT=7
MsgType
Entries
good=0bad=1mixed=2warning=3info=4neutral=5debug=6headshot=7critical=8grazing=9
NpcAttitude
Entries
NPCATT_NULL=0NPCATT_TALK=1NPCATT_LEGACY_1=2NPCATT_FOLLOW=3NPCATT_LEGACY_2=4NPCATT_LEAD=5NPCATT_WAIT=6NPCATT_LEGACY_6=7NPCATT_MUG=8NPCATT_WAIT_FOR_LEAVE=9NPCATT_KILL=10NPCATT_FLEE=11NPCATT_LEGACY_3=12NPCATT_HEAL=13NPCATT_LEGACY_4=14NPCATT_LEGACY_5=15NPCATT_ACTIVITY=16NPCATT_FLEE_TEMP=17NPCATT_RECOVER_GOODS=18
NpcNeed
Entries
need_none=0need_ammo=1need_weapon=2need_gun=3need_food=4need_drink=5need_safety=6
OtMatchType
Entries
EXACT=0TYPE=1PREFIX=2CONTAINS=3
SfxChannel
Entries
daytime_outdoors_env=0nighttime_outdoors_env=1underground_env=2indoors_env=3indoors_rain_env=4outdoors_snow_env=5outdoors_flurry_env=6outdoors_thunderstorm_env=7outdoors_rain_env=8outdoors_drizzle_env=9outdoor_blizzard=10deafness_tone=11danger_extreme_theme=12danger_high_theme=13danger_medium_theme=14danger_low_theme=15stamina_75=16stamina_50=17stamina_35=18idle_chainsaw=19chainsaw_theme=20player_activities=21exterior_engine_sound=22interior_engine_sound=23radio=24
VitaminType
Entries
vitamin=0toxin=1drug=2counter=3
Libraries
ch_names
Members
generate
🇫 Function --> ( boolean? ) -> string
Generates a random full name with an optional boolean for gender. The loaded name is one of usage with optional gender. The combinations used in names files are as follows: Backer | (Female|Male|Unisex) Given | (Female|Male) // unisex names are duplicated in each group Family | Unisex Nick City World
pick
🇫 Function --> ( any ) -> string
Generates a single name using any combination of search flags.
const
Various game constants
Members
OM_OMT_SIZE
🇨 Constant --> integer = 180
OMT_SM_SIZE
🇨 Constant --> integer = 2
OMT_MS_SIZE
🇨 Constant --> integer = 24
OM_MS_SIZE
🇨 Constant --> integer = 4320
OM_SM_SIZE
🇨 Constant --> integer = 360
SM_MS_SIZE
🇨 Constant --> integer = 12
coords
Methods for manipulating coord systems and calculating distance
Members
ms_to_sm
🇫 Function --> ( Tripoint ) -> (Tripoint,Point)
om_to_ms
🇫 Function --> ( Point, Tripoint? ) -> Tripoint
rl_dist
🇫 Function --> ( Tripoint, Tripoint ) -> integer
🇫 Function --> ( Point, Point ) -> integer
trig_dist
🇫 Function --> ( Tripoint, Tripoint ) -> number
🇫 Function --> ( Point, Point ) -> number
omt_to_ms
🇫 Function --> ( Tripoint, Point? ) -> Tripoint
ms_to_om
🇫 Function --> ( Tripoint ) -> (Point,Tripoint)
sm_to_ms
🇫 Function --> ( Tripoint, Point? ) -> Tripoint
ms_to_omt
🇫 Function --> ( Tripoint ) -> (Tripoint,Point)
square_dist
🇫 Function --> ( Tripoint, Tripoint ) -> integer
🇫 Function --> ( Point, Point ) -> integer
date_time
System date and time API.
Members
year
🇫 Function --> ( ) -> integer
hour
🇫 Function --> ( ) -> integer
0 -> 23
minute
🇫 Function --> ( ) -> integer
second
🇫 Function --> ( ) -> integer
day
🇫 Function --> ( ) -> integer
weekday
🇫 Function --> ( ) -> integer
Days since Saturday.
weekday_str
🇫 Function --> ( ) -> string
month
🇫 Function --> ( ) -> integer
millisecond
🇫 Function --> ( ) -> integer
gapi
Global game methods
Members
get_avatar
🇫 Function --> ( ) -> Avatar
choose_direction
🇫 Function --> ( string, boolean? ) -> Tripoint?
look_around
🇫 Function --> ( ) -> Tripoint?
play_variant_sound
🇫 Function --> ( string, string, integer )
🇫 Function --> ( string, string, integer, Angle, number, number )
choose_adjacent
🇫 Function --> ( string, boolean? ) -> Tripoint?
get_character_at
🇫 Function --> ( Tripoint, boolean? ) -> Character
get_npc_at
🇫 Function --> ( Tripoint, boolean? ) -> Npc
spawn_hallucination
🇫 Function --> ( Tripoint ) -> boolean
place_monster_around
🇫 Function --> ( MonsterTypeId, Tripoint, integer ) -> Monster
play_ambient_variant_sound
🇫 Function --> ( string, string, integer, SfxChannel, integer, number, integer )
remove_npc_follower
🇫 Function --> ( Npc )
get_overmap_buffer
🇫 Function --> ( ) -> OvermapBuffer
Get the global overmap buffer
direction_from
🇫 Function --> ( Tripoint ) -> CppVal<direction>
Get direction from a tripoint delta
add_npc_follower
🇫 Function --> ( Npc )
get_simulated_npcs
🇫 Function --> ( ) -> table
Returns NPCs in simulated (fully loaded, AI-eligible) submaps as a Lua array.
get_all_npcs
🇫 Function --> ( ) -> table
Returns all active NPCs as a Lua array.
get_all_monsters
🇫 Function --> ( ) -> table
Returns all active monsters as a Lua array.
get_all_creatures
🇫 Function --> ( ) -> table
Returns all active creatures (monsters, NPCs, and the player) as a Lua array.
direction_name
🇫 Function --> ( CppVal<direction> ) -> string
Get direction name from direction enum
place_monster_at
🇫 Function --> ( MonsterTypeId, Tripoint ) -> Monster
get_creature_at
🇫 Function --> ( Tripoint, boolean? ) -> Creature
place_player_overmap_at
🇫 Function --> ( Tripoint )
Teleports player to absolute coordinate in overmap
place_player_local_at
🇫 Function --> ( Tripoint )
Teleports player to local coordinates within active map
current_turn
🇫 Function --> ( ) -> TimePoint
add_msg
🇫 Function --> ( MsgType, any )
🇫 Function --> ( any )
get_distribution_grid_tracker
🇫 Function --> ( ) -> DistributionGridTracker
light_ambient_lit
🇫 Function --> ( ) -> number
get_map
🇫 Function --> ( ) -> Map
get_monster_at
🇫 Function --> ( Tripoint, boolean? ) -> Monster
turn_zero
🇫 Function --> ( ) -> TimePoint
rng
🇫 Function --> ( integer, integer ) -> integer
register_action_menu_entry
🇫 Function --> ( table )
Register a Lua-defined action menu entry in the in-game action menu.
create_item
🇫 Function --> ( ItypeId, integer ) -> Detached<Item>
Spawns a new item. Same as
Item::spawn
before_time_starts
🇫 Function --> ( ) -> TimePoint
add_on_every_x_hook
🇫 Function --> ( TimeDuration, function )
get_messages
🇫 Function --> ( integer ) -> table
Get recent player message log entries. Returns array of { time=string, text=string }.
get_lua_log
🇫 Function --> ( integer ) -> table
Get recent Lua console log entries. Returns array of { level=string, text=string, from_user=bool }.
six_cardinal_directions
🇫 Function --> ( ) -> Tripoint[]
Get the six cardinal directions (N, S, E, W, Up, Down)
gdebug
Debugging and logging API.
Members
log_info
🇫 Function --> ( any )
clear_lua_log
🇫 Function --> ( )
set_log_capacity
🇫 Function --> ( integer )
reload_lua_code
🇫 Function --> ( )
debugmsg
🇫 Function --> ( any )
log_warn
🇫 Function --> ( any )
log_error
🇫 Function --> ( any )
save_game
🇫 Function --> ( ) -> boolean
hooks
Documentation for hooks
Members
on_game_save
🇫 Function --> ( )
Called when game is about to save.
on_character_death
🇫 Function --> ( params: table )
Called when a character is dead.
The hook receives a table with keys:
on_shoot
🇫 Function --> ( params: table )
Called when shot(s) is fired from a gun.
The hook receives a table with keys:
on_throw
🇫 Function --> ( params: table )
Called when an item is thrown.
The hook receives a table with keys:
on_mon_effect_added
🇫 Function --> ( params: table )
Called when monster gets the effect which has
EFFECT_LUA_ON_ADDEDflag.
The hook receives a table with keys:
on_character_effect_removed
🇫 Function --> ( params: table )
Called when character loses the effect which has
EFFECT_LUA_ON_REMOVEDflag.
The hook receives a table with keys:
on_character_effect_added
🇫 Function --> ( params: table )
Called when character gets the effect which has
EFFECT_LUA_ON_ADDEDflag.
The hook receives a table with keys:
on_character_effect
🇫 Function --> ( params: table )
Called when character is on the effect which has
EFFECT_LUA_ON_TICKflag.
The hook receives a table with keys:
on_character_display_skill_info
🇫 Function --> ( params: table )
Called when drawing skill info on the character display (
@) skill tab.
The hook receives a table with keys:
on_character_display_skill_action
🇫 Function --> ( params: table )
Called when a skill is confirmed on the character display (
@) skill tab.
The hook receives a table with keys:
on_mon_effect
🇫 Function --> ( params: table )
Called when character is on the effect which has
EFFECT_LUA_ON_TICKflag.
The hook receives a table with keys:
on_mon_death
🇫 Function --> ( params: table )
Called when a monster is dead.
The hook receives a table with keys:
on_monster_loaded
🇫 Function --> ( params: table )
Called when a monster is loaded onto the active map.
Also triggerson_creature_loaded.
The hook receives a table with keys:
monster(Monster)
on_npc_loaded
🇫 Function --> ( params: table )
Called when an NPC is loaded onto the active map.
Also triggerson_creature_loaded.
The hook receives a table with keys:
npc(Npc)
on_mon_effect_removed
🇫 Function --> ( params: table )
Called when monster loses the effect which has
EFFECT_LUA_ON_REMOVEDflag.
The hook receives a table with keys:
on_creature_loaded
🇫 Function --> ( params: table )
Called when any creature is loaded onto the active map.
This is the base hook;on_monster_loadedandon_npc_loadedalso trigger this.
The hook receives a table with keys:
creature(Creature)
on_monster_spawn
🇫 Function --> ( params: table )
Called when a monster is spawned for the first time.
Also triggerson_creature_spawn.
Note: monsters spawned via mapgen submap spawn points will fire this hook,
but monsters materialized from overmap monster groups may not.
The hook receives a table with keys:
monster(Monster)
on_npc_spawn
🇫 Function --> ( params: table )
Called when an NPC is spawned for the first time.
Also triggerson_creature_spawn.
The hook receives a table with keys:
npc(Npc)
on_creature_spawn
🇫 Function --> ( params: table )
Called when any creature is spawned for the first time.
This is the base hook;on_monster_spawnandon_npc_spawnalso trigger this.
The hook receives a table with keys:
creature(Creature)
on_every_x
🇫 Function --> ( table )
Called every in-game period
on_character_reset_stats
🇫 Function --> ( params: table )
Called when character stat gets reset.
The hook receives a table with keys:
character(Character)
on_monster_try_move
🇫 Function --> ( params: table )
Called when a monster attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
The hook receives a table with keys:
on_try_npc_interaction
🇫 Function --> ( params: table )
Called when the player tries to interact with an NPC.
The hook receives a table with keys:
npc(NPC): The NPC being interacted with
Return false to prevent the npc interaction menu from appearing.
on_npc_interaction
🇫 Function --> ( params: table )
Called when the player interacts with an NPC.
The hook receives a table with keys:
npc(NPC): The NPC being interacted with
on_try_monster_interaction
🇫 Function --> ( params: table )
Called when the player tries to interact with a monster.
The hook receives a table with keys:
monster(Monster): The monster being interacted with
Return false to prevent monster interaction actions from running.
on_weather_updated
🇫 Function --> ( params: table )
Called every 5 minutes when weather data is updated.
The hook receives a table with keys:
weather_id(string): Current weather IDtemperature(float): Current temperature in Celsiustemperature_f(float): Current temperature in Fahrenheitwindspeed(float): Wind speedwinddirection(integer): Wind direction in degreeshumidity(float): Humidity percentagepressure(float): Atmospheric pressureis_sheltered(boolean): Whether player is sheltered
on_game_started
🇫 Function --> ( )
Called when the game has first started.
on_weather_changed
🇫 Function --> ( params: table )
Called when the weather has changed.
The hook receives a table with keys:
weather_id(string): Current weather IDold_weather_id(string): Previous weather IDtemperature(float): Current temperature in Celsiustemperature_f(float): Current temperature in Fahrenheitwindspeed(float): Wind speedwinddirection(integer): Wind direction in degreeshumidity(float): Humidity percentagepressure(float): Atmospheric pressureis_sheltered(boolean): Whether player is sheltered
on_game_load
🇫 Function --> ( )
Called right after game has loaded.
on_character_try_move
🇫 Function --> ( params: table )
Called after on_player_try_move or on_npc_try_move regardless of whether the specific hook vetoed.
All registered callbacks run; if any returns false, movement is blocked.
The hook receives a table with keys:
char(Character)from(Tripoint)to(Tripoint)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
Return false to block the move.
on_dialogue_start
🇫 Function --> ( params: table )
Called just before the dialogue window opens and the first topic is chosen.
The hook receives a table with keys:
npc(NPC): The NPC speakingnext_topic(string): The topic that will be shown first
Return a new talk_topic id to add it as the next topic.
on_dialogue_end
🇫 Function --> ( params: table )
Called when the dialogue window closes.
The hook receives a table with keys:
npc(NPC): The NPC speaking
on_player_try_move
🇫 Function --> ( params: table )
Called when the player attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
The hook receives a table with keys:
player(Player)from(Tripoint)to(Tripoint)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
Return false to block the move.
on_npc_try_move
🇫 Function --> ( params: table )
Called when an NPC attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
The hook receives a table with keys:
npc(Npc)from(Tripoint)to(Tripoint)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
Return false to block the move.
on_dialogue_option
🇫 Function --> ( params: table )
Called when a dialogue option is selected.
The hook receives a table with keys:
npc(NPC): The NPC speakingnext_topic(string): The topic that was selected
Return a new talk_topic id to add it as the next topic.
on_creature_melee_attacked
🇫 Function --> ( params: table )
Called after a character or monster has attacked in melee.
The hook receives a table with keys:
on_creature_blocked
🇫 Function --> ( params: table )
Called when a character successfully blocks.
The hook receives a table with keys:
char(Character)source(Creature)bodypart_id(BodyPartTypeId)damage_instance(DamageInstance)damage_blocked(float)
on_creature_performed_technique
🇫 Function --> ( params: table )
Called when a character has performed a technique.
The hook receives a table with keys:
char(Character)technique(MartialArtsTechniqueRaw)target(Creature)damage_instance(DamageInstance)move_cost(integer)
on_creature_dodged
🇫 Function --> ( params: table )
Called when a character or monster successfully dodges.
The hook receives a table with keys:
on_mapgen_postprocess
🇫 Function --> ( params: table )
Called right after mapgen has completed.
The hook receives a table with keys:
locale
Localization API.
Members
gettext
🇫 Function --> ( string ) -> string
Expects english source string, returns translated string.
pgettext
🇫 Function --> ( string, string ) -> string
First is context string. Second is english source string.
vgettext
🇫 Function --> ( string, string, integer ) -> string
First is english singular string, second is english plural string. Number is amount to translate for.
vpgettext
🇫 Function --> ( string, string, string, integer ) -> string
First is context string. Second is english singular string. third is english plural. Number is amount to translate for.
monster_groups
Monster group definitions and helpers
Members
get_all_ids
🇫 Function --> ( ) -> MonsterGroupId[]
List all monster group ids currently loaded.
get_monsters_from_group
🇫 Function --> ( MonsterGroupId ) -> MonsterTypeId[]
Get the monster ids directly listed in a group (default monster first).
get_all
🇫 Function --> ( ) -> MonsterGroupRaw[]
Get all monster group definitions.
get_group
🇫 Function --> ( MonsterGroupId ) -> MonsterGroupRaw
Get a monster group definition by id.
monster_types
Monster type definitions and helpers
Members
get_all_ids
🇫 Function --> ( ) -> MonsterTypeId[]
List all monster type ids currently loaded.
overmapbuffer
Global overmap buffer interface for finding and inspecting overmap terrain.
Members
find_all
🇫 Function --> ( Tripoint, OmtFindParams ) -> Tripoint[]
Find all overmap terrain tiles matching the given parameters. Returns a vector of tripoints.
monster_groups_at
🇫 Function --> ( Tripoint ) -> Mongroup[]
List monster groups influencing the given overmap tile (absolute OMT coordinates).
remove_grid_connection
🇫 Function --> ( Tripoint, Tripoint ) -> boolean
Remove an electric grid connection between two positions. Returns true on success.
add_grid_connection
🇫 Function --> ( Tripoint, Tripoint ) -> boolean
Add an electric grid connection between two positions. Returns true on success.
electric_grid_connectivity_at
🇫 Function --> ( Tripoint ) -> Tripoint[]
Get all electric grid connections from the given position. Returns vector of relative tripoint offsets.
hordes_at
🇫 Function --> ( Tripoint ) -> Mongroup[]
List hordes influencing the given overmap tile (absolute OMT coordinates).
has_horde
🇫 Function --> ( Tripoint ) -> boolean
Check if a horde is present at the given overmap tile.
horde_count
🇫 Function --> ( Tripoint ) -> integer
Count hordes influencing the given overmap tile (absolute OMT coordinates).
signal_hordes
🇫 Function --> ( Tripoint, integer )
Signal nearby hordes toward an absolute submap position with the given strength.
horde_size
🇫 Function --> ( Tripoint ) -> integer
Get the estimated size of the horde at the given overmap tile.
move_hordes
🇫 Function --> ( )
Advance horde movement across all loaded overmaps.
electric_grid_at
🇫 Function --> ( Tripoint ) -> Tripoint[]
Get all overmap tiles belonging to the electric grid at the given position. Returns vector of tripoints.
get_note
🇫 Function --> ( Tripoint ) -> string?
Get a player note at the given position. Returns string or nil.
ter
🇫 Function --> ( Tripoint ) -> OterIntId
Get the overmap terrain type at the given position. Returns an oter_id.
find_random
🇫 Function --> ( Tripoint, OmtFindParams ) -> Tripoint?
Find a random overmap terrain tile matching the given parameters. Returns a tripoint or nil if not found.
find_closest
🇫 Function --> ( Tripoint, OmtFindParams ) -> Tripoint?
Find the closest overmap terrain tile matching the given parameters. Returns a tripoint or nil if not found.
set_note
🇫 Function --> ( Tripoint, string? )
Set a player note at the given position. Pass nil or empty string to clear.
check_ot
🇫 Function --> ( string, OtMatchType, Tripoint ) -> boolean
Check if the terrain at the given position matches the type and match mode. Returns boolean.
set_seen
🇫 Function --> ( Tripoint, boolean? )
Set the seen status of terrain at the given position.
seen
🇫 Function --> ( Tripoint ) -> boolean
Check if the terrain at the given position has been seen by the player. Returns boolean.
is_explored
🇫 Function --> ( Tripoint ) -> boolean
Check if the terrain at the given position has been explored by the player. Returns boolean.
reveal
🇫 Function --> ( Tripoint, integer, function? ) -> boolean
Reveal a square area around a center point on the overmap. Returns true if any new tiles were revealed. Optional filter callback receives oter_id and should return true to reveal that tile.
create_horde
🇫 Function --> ( table ) -> Mongroup
Create a monster horde at the given absolute OMT position. Pass a table with fields: type (mongroup_id, required), pos (tripoint abs_omt, required), radius (int), population (int), horde (bool), behaviour (string), diffuse (bool), target (tripoint abs_omt).
sidebar
Sidebar utility functions.
Members
register_widget
🇫 Function --> ( table )
Register a Lua sidebar widget. Options: id(string), name(string), height(int, use -2 to fill remaining space), order(int, 1-based), draw(function), default_toggle(bool), redraw_every_frame(bool), panel_visible(bool|function), render(function). draw(width, height) returns an array of entries: each entry is string or table { text=string, color=
Color|string }. text may include color tags like <color_red>text for multi-color lines.
clear_widgets
🇫 Function --> ( )
Clear all registered Lua sidebar widgets.
get_layout_id
🇫 Function --> ( ) -> string
Returns current sidebar layout id (e.g. classic, compact, labels).
tests_lib
Library for testing purposes
Members
my_awesome_lambda_1
🇫 Function --> ( ) -> integer
my_awesome_lambda_2
🇫 Function --> ( ) -> integer