[Package Index | Mudlib Index | Effect Index]

File /obj/weapons/inherits/fired_weapon.c

This method sets the 'power' the weapon has if thrown/fired. If real ranged combat comes in this can also be the maximum distance (in metres - use suggested values below). The power will be used with the weapon or ammunition weight to determine how much damage is done on impact.

Inherits

This class inherits the following classes /obj/baggage.c and /std/basic/ranged_inherit.c

Includes

This class includes the following files /include/tasks.h, /include/move_failures.h, /include/tokenise.h and /include/parser.h

Method index

Public Functions

These are functions that everyone can access.

check_misfire
void check_misfire()
do_drawn_fire
int do_drawn_fire(object * ammos,
                  object * targets)
do_fire
int do_fire(object * targets)
do_load_weapon
int do_load_weapon(object * ammos)
event_move_object
void event_move_object(mixed from,
                       mixed to)
failed_move_reason
mixed failed_move_reason(object ammo)
fake_fire
int fake_fire(object target,
              int success)

This function fakes firing the weapon at the target and is called by inhume.
held_this_item
int held_this_item(int held,
                   object holder,
                   mixed arg)
query_ammo
object query_ammo()

This will return the ammo object to be fired.

Returns:
The ammo object.

See also:
set_ammo_type.c and query_ammo_type .c


query_ammo_type
mixed query_ammo_type()

This returns the ammo type this weapon uses.

Returns:
the name or an array of names of the ammo to be used

See also:
set_ammo_type.c and query_ammo .c


query_attack_data
mixed * query_attack_data()
query_capacity
int query_capacity()

Returns the amount of ammo the weapon can hold.

Returns:
the capacity of the weapon

See also:
set_capacity .c


query_fired_difficulty
int query_fired_difficulty()

This returns the minimum bonus needed for the weapon to be used.

Returns:
the bonus needed, use query_fired_skill to get the skill used.

See also:
set_fired_difficulty.c and query_fired_skill .c


query_fired_skill
string query_fired_skill()

This returns the skill used to fire the weapon.

Returns:
the skill used to fire the weapon

See also:
set_fired_type .c


query_fired_type
string query_fired_type()

This returns the type of fired weapon it is.

Returns:
the type of fired weapon, either "drawn", "triggered" or "blown"

See also:
set_fired_type .c


query_fired_weapon
int query_fired_weapon()
query_must_load
int query_must_load()

This returns whether the weapon must be loaded with ammunition. All triggered, by default, must be loaded. You can make a more interesting load function by defining int load_weapon( object player, object ammo ) on the weapon. All skillchecks and failed/succeeded messages should be included in this function. Return 0 if a requirement has not been met, return -1 if all requirements have been met but they failed the skillcheck and so the weapon should not be loaded and 1 if the weapon should be loaded, the actual move is handled in the inherit.

Returns:
1 if the weapon must be loaded using the load command, 0 if not.


query_ranged_power
int query_ranged_power()

This returns the ranged power of the weapon.

Returns:
An int between 1 and 150 or 0.

See also:
set_ranged_power .c


query_weapon
int query_weapon()
set_ammo_type
void set_ammo_type(mixed ammo)

Set the ammo type here, your ammo has to full_id() to this or it can not be added.

Parameters:
the - name of the ammo or an array of names

See also:
query_ammo_type.c and query_ammo .c

Example:
set_ammo_type( ({ "toy bolt", "rubber bolt" }) );

set_capacity
void set_capacity(int capacity)

Set the capacity of this weapon.

Parameters:
The - amount of ammo it can hold

See also:
query_capacity.c, set_ammo_type.c and query_ammo_type .c


set_fired_difficulty
void set_fired_difficulty(int difficulty)

Set the difficulty of using this weapon, this is the minimum bonus (fired for triggered and blown weapons and bow for drawn weapons) needed to use the weapon. Triggered weapons should generally be easier to fire.

Parameters:
difficulty - the base difficulty

See also:
query_fired_difficulty.c and query_fired_skill .c


set_fired_type
void set_fired_type(string type)

This sets the type of fired weapon it is and will automatically set the fired skill. At the moment "drawn" (eg recurve bow, sling shot) "triggered" (eg crossbow) and "blown" (eg blowpipe) weapons are catered for. All triggered weapons must be loaded with the load command before they can be fired.

See also:
query_fired_type.c, query_fired_skill.c and query_must_load .c


set_ranged_power
void set_ranged_power(int power)
test_add
int test_add(object ammo,
             int flag)
weapon_stats
mixed weapon_stats()