====== _gen_door_dam.nss ====== ===== Usage ===== Thsi script is used as a [[OnDamaged]] handler script of the door, placeables or secret doors. This should be used by all doors. If special handing is required use [[Hooks]] to modify the behavior of this script. ===== What it does ===== This function will do following things: - [[Hooks]]: Call the [[builders:placeablesvariables#OnDamaged|OnDamaged]] hook if defined. - Heal: Heal the door with the amount of damage dealt. - Keys: Check if the door requires specific key, and if so complain. - Locked: Check if the door is locke, and if not complain. - Keep locked: If door is supposed to be kept locked [[builders:placeablesvariables#door_keep_locked|door_keep_locked on door]] or [[builders:areavariables#door_keep_locked|door_keep_locked on area]], exit. - Damage: Add damage dealt to ''damage'' variable and check it against [[builders:placeablesvariables#damage_limit|damage_limit]] or DC*DC. If damage limit is negative exit. - Opening: If enough damage dealt open door. Visual effects used [[builders:placeablesvariables#force_vfx*]], [[builders:placeablesvariables#force_vfx_player*]] [[builders:placeablesvariables#damage_vfx*]] and [[builders:placeablesvariables#damage_vfx_player*]]. ===== Related things ===== [[builders:placeablesvariables|Variables in the placeables]]\\ [[Hooks]]\\ [[_gen_door_are]]\\ [[_gen_door_clo]]\\ [[_gen_door_fai]]\\ [[_gen_door_loc]]\\ [[_gen_door_ope]]\\ [[_gen_door_unl]]