MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // living/combat.h -- combat header |
| 4 | // |
| 5 | // $Id: combat.h 9008 2015-01-06 17:20:17Z Zesstra $ |
| 6 | |
| 7 | #ifndef __LIVING_COMBAT_H__ |
| 8 | #define __LIVING_COMBAT_H__ |
| 9 | |
| 10 | // properties |
| 11 | #define P_DISABLE_ATTACK "disable_attack" |
| 12 | #define P_NEXT_DISABLE_ATTACK "next_disable_attack" |
| 13 | |
| 14 | #define P_CORPSE "corpse" |
| 15 | #define P_NOCORPSE "nocorpse" |
| 16 | |
| 17 | // bitte P_ARMOURS auch in /secure/master.h aendern, falls das mal geaendert |
| 18 | // wird. |
| 19 | #define P_ARMOURS "armours" |
| 20 | #define P_BODY "body" |
| 21 | |
| 22 | #define P_RESISTANCE_STRENGTHS "resistance_strengths" |
| 23 | #define P_RESISTANCE_MODIFIER "rstr:mod" |
| 24 | #define P_RESISTANCE "resistance" |
| 25 | #define P_VULNERABILITY "vulnerability" |
| 26 | #define P_TOTAL_AC "total_ac" |
| 27 | #define P_TOTAL_WC "total_wc" |
| 28 | |
| 29 | #define P_HANDS "hands" |
| 30 | #define P_MAX_HANDS "max_hands" |
| 31 | #define P_USED_HANDS "used_hands" |
| 32 | #define P_FREE_HANDS "free_hands" |
| 33 | #define P_HANDS_USED_BY "hands_used_by" |
| 34 | |
| 35 | #define P_ATTACK_BUSY "attack_busy" |
| 36 | #define P_NO_ATTACK "no_attack" |
| 37 | |
| 38 | #define P_PREFERED_ENEMY "pref_enemy" |
| 39 | #define P_SHOW_ATTACK_MSG "show_attack_msg" |
| 40 | |
| 41 | #define P_LAST_DAMAGE "last_damage" |
| 42 | #define P_LAST_DAMTYPES "last_damtypes" |
| 43 | #define P_LAST_DAMTIME "last_damtime" |
| 44 | |
| 45 | #define P_DEATH_SPONSORED_BY "responsible_wizard_for_death" |
| 46 | #define P_KILLER "killer" |
| 47 | #define P_MURDER_MSG "murder_msg" |
| 48 | #define P_FORCE_MURDER_MSG "force_murder_msg" |
| 49 | #define P_ENEMY_DEATH_SEQUENCE "enemy_death_sequence" |
| 50 | #define P_NEXT_DEATH_SEQUENCE "p_lib_next_death_sequence" |
| 51 | #define P_DEATH_MSG "death_msg" |
| 52 | |
| 53 | #define P_HUNTTIME "p_lib_hunttime" |
| 54 | |
| 55 | // Befriede: Gildenzaehler |
| 56 | #define P_PEACE_HISTORY "_peace_history" |
| 57 | |
| 58 | #define DISABLE_TOO_EARLY -100111 |
| 59 | |
| 60 | #define ENEMY_HUNTTIME 0 |
| 61 | |
| 62 | // Helfer-NPC |
| 63 | // a) NPC: welchem Spieler ist dieser NPC zugeordnet, d.h. fuer wen kaempft |
| 64 | // er? Array: ({ spielerobject, flags }) |
| 65 | // b) Spieler: welche NPC sind diesem Spieler zugeordnet. Mapping mit Objekten |
| 66 | // und Flags. |
| 67 | #define P_HELPER_NPC "std:helper_npc" |
| 68 | // Flags: |
| 69 | // 2 Klassen von Helfern momentan: Gilden-NPC und sonstige. |
| 70 | #define GUILD_HELPER 0x1 |
| 71 | #define MISC_HELPER 0x2 |
| 72 | // Wenn gesetzt, ist der Helfer exklusiv und laesst keinen anderen in der |
| 73 | // derselben Klasse zu. |
| 74 | #define EXCLUSIVE_HELPER 0x40000000 |
| 75 | // Wenn gesetzt, ist der Helfer 'aktiv', d.h. nicht nur Schlagfaenger |
| 76 | #define ACTIVE_HELPER 0x20000000 |
| 77 | |
| 78 | // individuelle Schadensmeldungen eines Lebewesens |
| 79 | #define P_DAMAGE_MSG "std_p_dam_msg" |
| 80 | |
| 81 | #endif // __LIVING_COMBAT_H__ |
| 82 | |
| 83 | #ifdef NEED_PROTOTYPES |
| 84 | |
| 85 | #ifndef __LIVING_COMBAT_H_PROTO__ |
| 86 | #define __LIVING_COMBAT_H_PROTO__ |
| 87 | |
| 88 | // prototypes |
| 89 | public int Kill(object ob); |
| 90 | public void Attack2(object enemy); |
| 91 | public void Attack(object enemy); |
| 92 | public void AddDefender(object friend); |
| 93 | public void RemoveDefender(object friend); |
| 94 | public void InformDefend(object enemy); |
| 95 | public mixed DefendOther(int dam, string|string* dam_type, int|mapping spell, object enemy); |
| 96 | public int Defend(int dam, string|string* dam_type, int|mapping spell, object enemy); |
| 97 | public void CheckWimpyAndFlee(); |
| 98 | public varargs void Flee(object oldenv, int force); |
| 99 | |
| 100 | public varargs int StopHuntFor(object arg, int silent); |
| 101 | public varargs mapping StopHuntingMode(int silent); |
| 102 | |
| 103 | public void UpdateResistanceStrengths(); |
| 104 | public varargs int AddResistanceModifier(mapping mod, string add); |
| 105 | public varargs void RemoveResistanceModifier(string add); |
| 106 | public float CheckResistance(string* dam_type); |
| 107 | |
| 108 | public int InsertSingleEnemy(object ob); |
| 109 | public int InsertEnemy(object ob); |
| 110 | public int IsEnemy(object wer); |
| 111 | public object *PresentEnemies(); |
| 112 | public object QueryPreferedEnemy(); |
| 113 | public varargs object SelectEnemy(object *here); |
| 114 | public <object*|int*>* QueryEnemies(); |
| 115 | public mapping GetEnemies(); |
| 116 | #if __VERSION_MAJOR__>=3 && __VERSION_MINOR__>=5 && (__VERSION_MICRO__>0 || (__VERSION_MICRO__==0 && __VERSION_PATCH__>=2)) |
| 117 | public mapping SetEnemies(<object*|int*>* myenemies); |
| 118 | #else |
| 119 | public mapping SetEnemies(mixed *myenemies); |
| 120 | #endif |
| 121 | public mixed EnemyPresent(); |
| 122 | public mixed InFight(); |
| 123 | public int CheckEnemy(object ob); |
| 124 | |
| 125 | public int SpellDefend(object caster, mapping sinfo); |
| 126 | |
| 127 | public object|object* QueryArmourByType(string type); |
| 128 | |
| 129 | public varargs int UseHands(object ob, int num); |
| 130 | public varargs int FreeHands(object ob); |
| 131 | |
| 132 | public void InitAttack(); |
| 133 | public void ExitAttack(); |
| 134 | |
| 135 | public int Pacify(object caster); |
| 136 | |
| 137 | public varargs int StopHuntID(string str, int silent); |
| 138 | public void StopHuntText(object arg); |
| 139 | public varargs void ExecuteMissingAttacks(object *remove_attackers); |
| 140 | |
| 141 | // Query- und Set-Methoden |
| 142 | static int _query_attack_busy(); |
| 143 | static int _query_free_hands(); |
| 144 | static mixed _query_hands(); |
| 145 | static mixed *_query_hands_used_by(); |
| 146 | static mapping _query_resistance_strengths(); |
| 147 | static int _query_total_ac(); |
| 148 | static int _query_total_wc(); |
| 149 | static int _query_used_hands(); |
| 150 | static int _set_attack_busy(mixed val); |
| 151 | static int _set_disable_attack(int val); |
| 152 | static mixed _set_hands(mixed h); |
| 153 | static mixed _set_resistance(mixed arg); |
| 154 | static int _set_used_hands(int new_num); |
| 155 | static mixed _set_vulnerability(mixed arg); |
| 156 | static int _set_wimpy(int i); |
| 157 | |
| 158 | // Internal |
| 159 | protected void SkillResTransfer(mapping from_M, mapping to_M); |
| 160 | protected void InternalModifyAttack(mapping ainfo); |
| 161 | protected void InternalModifyDefend(int dam, string* dt, mapping spell, object enemy); |
| 162 | protected string mess(string msg,object me,object enemy); |
| 163 | |
| 164 | #endif // __LIVING_COMBAT_H_PROTO__ |
| 165 | |
| 166 | #endif // NEED_PROTOYPES |