#include <sys_debug.h>#include <thing/properties.h>#include <attributes.h>#include <config.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | NEED_PROTOTYPES |
Funktionen | |
| nomask public int | SetTimedAttrModifier (string key, mapping modifier, int outdated, object dependent, mixed notify) |
| nomask public mapping | QueryTimedAttrModifier (string key) |
| nomask public int | DeleteTimedAttrModifier (string key) |
| nomask protected void | attribute_hb () |
| nomask protected void | notifyExpiredModifiers (mapping nots) |
| nomask protected void | notifyInvalidModifiers () |
| protected nomask void | calculate_valid_modifiers () |
| nomask public void | deregister_modifier (object modifier) |
| nomask public void | register_modifier (object modifier) |
| protected void | add_offsets (mapping arr) |
| public void | UpdateAttributes () |
| protected void | create () |
| static mixed | _query_timed_attr_mod () |
| static mapping | _set_attributes (mapping arr) |
| static mapping | _query_attributes () |
| static mapping | _set_attributes_offsets (mapping arr) |
| static mapping | _query_attributes_offsets () |
| static mixed | _set_attributes_modifier (mixed arr) |
| static mapping | _query_attributes_modifier () |
| public int | SetAttr (string attr, int val) |
| public int | SetAttribute (string attr, int val) |
| public int | QueryAttribute (string attr) |
| public int | QueryRealAttribute (string attr) |
| public int | SetRealAttribute (string attr, int val) |
| public int | QueryAttributeOffset (string attr) |
| public status | TestLimitViolation (mapping check) |
| protected int | _filterattr_str (int val) |
| protected int | _filterattr_dex (int val) |
| protected int | _filterattr_int (int val) |
| protected int | _filterattr_con (int val) |
Variablen | |
| mapping | attributes |
| mapping | attributes_modifier |
| nosave mixed * | attributes_timed_mods |
| nosave mapping | attributes_offsets |
| nosave mapping | used_attributes_offsets |
| nosave object * | all_modifiers |
| nosave object * | invalid_modifiers |
| nosave int | cumulative_mod |
| nosave int | hp_off |
| nosave int | sp_off |
| #define NEED_PROTOTYPES |
Definiert in Zeile 31 der Datei attributes.c.
| protected int _filterattr_con | ( | int | val | ) |
Definiert in Zeile 661 der Datei attributes.c.
| protected int _filterattr_dex | ( | int | val | ) |
Definiert in Zeile 651 der Datei attributes.c.
| protected int _filterattr_int | ( | int | val | ) |
Definiert in Zeile 656 der Datei attributes.c.
| protected int _filterattr_str | ( | int | val | ) |
Definiert in Zeile 646 der Datei attributes.c.
| static mapping _query_attributes | ( | ) | [static] |
Definiert in Zeile 516 der Datei attributes.c.
00517 { 00518 return deep_copy(Set(P_ATTRIBUTES, attributes)); 00519 }
| static mapping _query_attributes_modifier | ( | ) | [static] |
Definiert in Zeile 568 der Datei attributes.c.
00569 { 00570 return deep_copy(attributes_modifier); 00571 }
| static mapping _query_attributes_offsets | ( | ) | [static] |
Definiert in Zeile 528 der Datei attributes.c.
00529 { 00530 return deep_copy(Set(P_ATTRIBUTES_OFFSETS, attributes_offsets)); 00531 }
| static mixed _query_timed_attr_mod | ( | ) | [static] |
Definiert in Zeile 501 der Datei attributes.c.
00501 { 00502 mixed ret; 00503 return Set(P_TIMED_ATTR_MOD, 00504 ({attributes_timed_mods[0], 00505 deep_copy(attributes_timed_mods[1]), 00506 deep_copy(attributes_timed_mods[2])})); 00507 }
| static mapping _set_attributes | ( | mapping | arr | ) | [static] |
Definiert in Zeile 509 der Datei attributes.c.
00510 { 00511 Set(P_ATTRIBUTES, attributes=arr); 00512 UpdateAttributes(); 00513 return arr; 00514 }
| static mixed _set_attributes_modifier | ( | mixed | arr | ) | [static] |
Definiert in Zeile 533 der Datei attributes.c.
00534 { string fn; 00535 mixed pre; 00536 mapping map_ldfied; 00537 00538 if ( pointerp(arr) && (sizeof(arr)>=2) ) 00539 { 00540 pre=arr[0]; 00541 map_ldfied=arr[1]; 00542 } 00543 else 00544 { 00545 pre=previous_object(); 00546 map_ldfied=arr; 00547 } 00548 00549 if ( objectp(pre) ) 00550 fn=old_explode(object_name(pre),"#")[0]; 00551 else 00552 fn=pre; 00553 00554 if ( !stringp(fn) ) 00555 return 0; 00556 00557 // wenn Modifier kein mapping oder ein leeres Mapping: loeschen 00558 if ( !mappingp(map_ldfied) || !sizeof(map_ldfied)) 00559 efun::m_delete(attributes_modifier,fn); 00560 else 00561 attributes_modifier[fn]=map_ldfied; 00562 00563 Set(P_ATTRIBUTES_MODIFIER, attributes_modifier); 00564 UpdateAttributes(); 00565 return attributes_modifier[fn]; 00566 }
| static mapping _set_attributes_offsets | ( | mapping | arr | ) | [static] |
Definiert in Zeile 521 der Datei attributes.c.
00522 { 00523 Set(P_ATTRIBUTES_OFFSETS, attributes_offsets=arr); 00524 UpdateAttributes(); 00525 return attributes_offsets; 00526 }
| protected void add_offsets | ( | mapping | arr | ) |
Definiert in Zeile 435 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
00435 { 00436 mixed *ind; 00437 int i; 00438 00439 if ( !mappingp(arr) ) 00440 return; 00441 00442 foreach(string key, int wert: arr) { 00443 used_attributes_offsets[key]+=wert; 00444 } 00445 }

| nomask protected void attribute_hb | ( | ) |
Definiert in Zeile 149 der Datei attributes.c.
Wird benutzt von heart_beat().
00150 { 00151 int now,i,k,update,outdated; 00152 string* keys; 00153 mapping tonotify; 00154 00155 // initialize 00156 now=time(); 00157 tonotify=([]); 00158 00159 keys=m_indices(attributes_timed_mods[TATTR_ENTRIES]); 00160 00161 // delete outdated 00162 for(i=sizeof(attributes_timed_mods[TATTR_OUTDATE])-1;i>=0;i--) 00163 { 00164 outdated=attributes_timed_mods[TATTR_OUTDATE][i]; 00165 if(outdated>now) 00166 { 00167 break; 00168 } 00169 00170 for(k=sizeof(keys)-1;k>=0;k--) 00171 { 00172 if(attributes_timed_mods[TATTR_ENTRIES][keys[k],TATTR_OUTDATED]==outdated) 00173 { 00174 // bei fehlendem notifier wurde das zum verhaengnis 00175 // dank an gloinson 00176 /* 00177 if(objectp(attributes_timed_mods[TATTR_ENTRIES][keys[k],TATTR_NOTIFY])) 00178 { 00179 */ 00180 tonotify+=([keys[k]:attributes_timed_mods[TATTR_ENTRIES][keys[k],TATTR_NOTIFY]]); 00181 //} 00182 00183 attributes_timed_mods[TATTR_DEPENDENTS]-=([keys[k]]); 00184 attributes_timed_mods[TATTR_ENTRIES]-=([keys[k]]); 00185 keys-=({keys[k]}); 00186 } 00187 } 00188 00189 attributes_timed_mods[TATTR_OUTDATE]-=({outdated}); 00190 } 00191 00192 // delete depending 00193 keys=m_indices(attributes_timed_mods[TATTR_DEPENDENTS]); 00194 for(i=sizeof(keys)-1;i>=0;i--) 00195 { 00196 if(!objectp(attributes_timed_mods[TATTR_DEPENDENTS][keys[i]])) 00197 { 00198 // siehe oben 00199 /* 00200 if(objectp(attributes_timed_mods[TATTR_ENTRIES][keys[i],TATTR_NOTIFY])) 00201 { 00202 */ 00203 tonotify+=([keys[i]:attributes_timed_mods[TATTR_ENTRIES][keys[i],TATTR_NOTIFY]]); 00204 //} 00205 00206 attributes_timed_mods[TATTR_DEPENDENTS]-=([keys[i]]); 00207 attributes_timed_mods[TATTR_ENTRIES]-=([keys[i]]); 00208 keys-=({keys[i]}); 00209 } 00210 } 00211 00212 00213 // update 00214 if(sizeof(tonotify)) 00215 { 00216 UpdateAttributes(); 00217 call_out(#'notifyExpiredModifiers,0,tonotify); 00218 } 00219 }

| protected nomask void calculate_valid_modifiers | ( | ) |
Definiert in Zeile 259 der Datei attributes.c.
Benutzt add_offsets(), all_modifiers, attributes_offsets, call_out(), CUMULATIVE_ATTR_LIMIT, cumulative_mod, hp_off, invalid_modifiers, ob(), P_HP, P_M_ATTR_MOD, P_M_HEALTH_MOD, P_SP, P_WIELDED, P_WORN, P_X_ATTR_MOD, P_X_HEALTH_MOD, qp, sp_off und used_attributes_offsets.
00259 { 00260 closure qp; 00261 mapping res; 00262 string key; 00263 int wert; 00264 // Unterscheidung Bonus <-> Malus, weil der Malus voll eingehen soll 00265 int hp_malus, sp_malus; 00266 00267 used_attributes_offsets=([]); 00268 cumulative_mod=0; 00269 hp_off=sp_off=0; 00270 invalid_modifiers=({}); 00271 00272 // rassenspezifische boni P_ATTRIBUTES_OFFSETS 00273 if ( mappingp(attributes_offsets) ) 00274 used_attributes_offsets+=attributes_offsets; 00275 00276 if (!pointerp(all_modifiers) || !sizeof(all_modifiers)) { 00277 // in diesem Fall koennen wir hier direkt mit dieser Funktion Schluss 00278 // machen. ;-) 00279 return; 00280 } 00281 else 00282 all_modifiers-=({0}); //zerstoerte Objekte rauswerfen. 00283 00284 // einmal ueber alle modifizierenden Objekt iterieren und aufaddieren 00285 foreach(object ob: all_modifiers) { 00286 qp = symbol_function("QueryProp",ob); 00287 00288 if (!objectp(ob) || environment(ob)!=this_object()) { 00289 all_modifiers-=({ob}); 00290 continue; 00291 } 00292 00293 // ext. Attribut-Modifier 00294 if ( mappingp(res=funcall(qp,P_X_ATTR_MOD)) ) { 00295 foreach(key, wert: res) { 00296 cumulative_mod+=wert; 00297 } 00298 } 00299 00300 // magic Attribut-Modifier 00301 if ( mappingp(res=funcall(qp,P_M_ATTR_MOD)) 00302 && ( funcall(qp,P_WORN) 00303 || funcall(qp,P_WIELDED) ) ) { 00304 foreach(key, wert: res) { 00305 cumulative_mod+=wert; 00306 } 00307 } 00308 // Magic Health-Modifier 00309 if ( mappingp(res=funcall(qp,P_M_HEALTH_MOD)) 00310 && ( funcall(qp,P_WORN) 00311 || funcall(qp,P_WIELDED) ) ) { 00312 if (res[P_HP] < 0) 00313 hp_malus += res[P_HP]; 00314 else 00315 hp_off+=res[P_HP]; 00316 00317 if (res[P_SP] < 0) 00318 sp_malus += res[P_SP]; 00319 else 00320 sp_off+=res[P_SP]; 00321 } 00322 00323 // external Health Modifier 00324 if ( mappingp(res=funcall(qp,P_X_HEALTH_MOD)) ) { 00325 if (res[P_HP] < 0) 00326 hp_malus += res[P_HP]; 00327 else 00328 hp_off+=res[P_HP]; 00329 00330 if (res[P_SP] < 0) 00331 sp_malus += res[P_SP]; 00332 else 00333 sp_off+=res[P_SP]; 00334 } 00335 00336 } // Ende 1. foreach() 00337 00338 00339 // und nochmal, soviele Objekt wieder rausschmeissen, bis das Limit wieder 00340 // unterschritten wird. (Verbesserungsvorschlaege erwuenscht.) :-( 00341 foreach(object ob: all_modifiers) { 00342 00343 qp = symbol_function("QueryProp",ob); 00344 00345 if ( mappingp(res=funcall(qp,P_X_ATTR_MOD)) ) { 00346 if(cumulative_mod>CUMULATIVE_ATTR_LIMIT) { 00347 invalid_modifiers+=({ob}); 00348 foreach(key, wert: res) { 00349 cumulative_mod-=wert; 00350 } 00351 } 00352 else { 00353 add_offsets(res); 00354 } 00355 } 00356 00357 if ( mappingp(res=funcall(qp,P_M_ATTR_MOD)) 00358 && ( funcall(qp,P_WORN) 00359 || funcall(qp,P_WIELDED) ) ) { 00360 if(cumulative_mod>CUMULATIVE_ATTR_LIMIT) { 00361 if(member(invalid_modifiers,ob)==-1) { 00362 invalid_modifiers+=({ob}); 00363 } 00364 foreach(key, wert: res) { 00365 cumulative_mod-=wert; 00366 } 00367 } 00368 else { 00369 add_offsets(res); 00370 } 00371 } 00372 } 00373 00374 // HEALTH_MOD werden durch eine Formel 'entschaerft', damit man nur schwer 00375 // das Maximum von 150 erreichen kann. (Formel von Humni, beschlossen auf 3. 00376 // EM-Treffen) 00377 // Mali gehen aber voll ein 00378 hp_off = (int)(150 - (150*150.0/(150 + hp_off))) + hp_malus; 00379 sp_off = (int)(150 - (150*150.0/(150 + sp_off))) + sp_malus; 00380 00381 /* alte Version 00382 hp_off += hp_malus; 00383 sp_off += sp_malus; 00384 */ 00385 00386 // notify invalid modifiers 00387 if(sizeof(invalid_modifiers)>0) { 00388 call_out(#'notifyInvalidModifiers,0); 00389 } 00390 }

| protected void create | ( | ) |
Definiert in Zeile 484 der Datei attributes.c.
00484 { 00485 hp_off=sp_off=0; 00486 used_attributes_offsets=([]); 00487 all_modifiers=({}); 00488 invalid_modifiers=({}); 00489 cumulative_mod=0; 00490 00491 Set(P_ATTRIBUTES_MODIFIER, attributes_modifier=([])); // nicht geschuetzt 00492 Set(P_ATTRIBUTES_OFFSETS, attributes_offsets=([])); 00493 Set(P_ATTRIBUTES_OFFSETS, PROTECTED, F_MODE); 00494 Set(P_ATTRIBUTES, attributes=([])); 00495 Set(P_ATTRIBUTES, PROTECTED, F_MODE); 00496 00497 Set(P_TIMED_ATTR_MOD, attributes_timed_mods=({ ({}),([]),([]) })); 00498 Set(P_TIMED_ATTR_MOD, NOSETMETHOD|SECURED, F_MODE_AS); 00499 }
| nomask public int DeleteTimedAttrModifier | ( | string | key | ) |
Definiert in Zeile 130 der Datei attributes.c.
00131 { 00132 if(!key || key=="") 00133 { 00134 return TATTR_INVALID_ARGS; 00135 } 00136 00137 if(!member(attributes_timed_mods[TATTR_ENTRIES],key)) 00138 { 00139 return TATTR_NO_SUCH_MODIFIER; 00140 } 00141 00142 attributes_timed_mods[TATTR_DEPENDENTS]-=([key]); 00143 attributes_timed_mods[TATTR_ENTRIES]-=([key]); 00144 UpdateAttributes(); 00145 00146 return TATTR_OK; 00147 }
| nomask public void deregister_modifier | ( | object | modifier | ) |
Definiert in Zeile 393 der Datei attributes.c.
Wird benutzt von RemoveSensitiveObject().
00394 { 00395 if (!pointerp(all_modifiers)) { 00396 return; 00397 } 00398 00399 // valid object? 00400 if (!objectp(modifier) || member(all_modifiers,modifier)==-1) { 00401 return; 00402 } 00403 00404 all_modifiers-=({modifier}); 00405 if (invalid_modifiers) { 00406 invalid_modifiers-=({modifier}); 00407 } 00408 }

| nomask protected void notifyExpiredModifiers | ( | mapping | nots | ) |
Definiert in Zeile 221 der Datei attributes.c.
00222 { 00223 int i; 00224 string* keys; 00225 while(remove_call_out(#'notifyExpiredModifiers)!=-1); 00226 00227 if(!nots) 00228 { 00229 return; 00230 } 00231 00232 keys=m_indices(nots); 00233 for(i=sizeof(nots)-1;i>=0;i--) 00234 { 00235 if(nots[keys[i]] && 00236 ( objectp(nots[keys[i]])||stringp(nots[keys[i]]) ) ) 00237 { 00238 call_other(nots[keys[i]],"NotifyTimedAttrModExpired",keys[i]); 00239 } 00240 } 00241 }
| nomask protected void notifyInvalidModifiers | ( | ) |
Definiert in Zeile 245 der Datei attributes.c.
Benutzt invalid_modifiers.
| public int QueryAttribute | ( | string | attr | ) |
Definiert in Zeile 589 der Datei attributes.c.
Wird benutzt von _query_max_weight(), _query_total_ac(), _query_total_wc(), Attack(), Pacify(), ShortRangeSkill(), StdSkill_Bihand(), StdSkill_Fight_hands() und StdSkill_Fight_sword().
00590 { int re; 00591 00592 re=attributes[attr]+used_attributes_offsets[attr]; 00593 00594 if ( query_once_interactive(this_object()) && (re>30) ) 00595 re=30; 00596 00597 return re; 00598 }

| public int QueryAttributeOffset | ( | string | attr | ) |
Definiert in Zeile 610 der Datei attributes.c.
00611 { 00612 return used_attributes_offsets[attr]; 00613 }
| public int QueryRealAttribute | ( | string | attr | ) |
Definiert in Zeile 600 der Datei attributes.c.
Wird benutzt von ask_question(), raise(), score() und SelectWhich().
00601 { 00602 return attributes[attr]; 00603 }

| nomask public mapping QueryTimedAttrModifier | ( | string | key | ) |
Definiert in Zeile 105 der Datei attributes.c.
00106 { 00107 int outdated; 00108 object dependent; 00109 mixed notify; 00110 mapping mod; 00111 00112 if(!key || key=="") 00113 { 00114 return ([]); 00115 } 00116 00117 if(!member(attributes_timed_mods[TATTR_ENTRIES],key)) 00118 { 00119 return ([]); 00120 } 00121 00122 mod=deep_copy(attributes_timed_mods[TATTR_ENTRIES][key,TATTR_MOD]); 00123 outdated=attributes_timed_mods[TATTR_ENTRIES][key,TATTR_OUTDATED]; 00124 dependent=attributes_timed_mods[TATTR_ENTRIES][key,TATTR_DEPENDENT]; 00125 notify=attributes_timed_mods[TATTR_ENTRIES][key,TATTR_NOTIFY]; 00126 00127 return ([key:mod;outdated;dependent;notify ]); 00128 }
| nomask public void register_modifier | ( | object | modifier | ) |
Definiert in Zeile 411 der Datei attributes.c.
Wird benutzt von InsertSensitiveObject().
00411 { 00412 closure qp; 00413 00414 if (!pointerp(all_modifiers)) { 00415 all_modifiers=({}); 00416 } 00417 00418 // valid object? 00419 if (!objectp(modifier) || environment(modifier)!=this_object() || 00420 member(all_modifiers,modifier)!=-1) { 00421 return; 00422 } 00423 00424 qp = symbol_function("QueryProp",modifier); 00425 // modifier after all? Die P_M_* muessen getragen/gezueckt sein. 00426 if(mappingp(funcall(qp,P_X_ATTR_MOD)) || 00427 mappingp(funcall(qp,P_X_HEALTH_MOD)) || 00428 ((mappingp(funcall(qp,P_M_ATTR_MOD)) || 00429 mappingp(funcall(qp,P_M_HEALTH_MOD))) && 00430 (funcall(qp,P_WORN) || funcall(qp,P_WIELDED)) ) ) { 00431 all_modifiers+=({modifier}); 00432 } 00433 }

| public int SetAttr | ( | string | attr, | |
| int | val | |||
| ) |
Definiert in Zeile 573 der Datei attributes.c.
Wird benutzt von _set_level().
00574 { closure filter_ldfied; 00575 00576 if ( filter_ldfied = symbol_function("_filterattr_"+attr, this_object()) ) 00577 val = funcall(filter_ldfied, val ); 00578 00579 attributes[attr] = val; 00580 UpdateAttributes(); 00581 }

| public int SetAttribute | ( | string | attr, | |
| int | val | |||
| ) |
Definiert in Zeile 583 der Datei attributes.c.
00584 { 00585 return SetAttr(attr, val-used_attributes_offsets[attr]); 00586 }
| public int SetRealAttribute | ( | string | attr, | |
| int | val | |||
| ) |
Definiert in Zeile 605 der Datei attributes.c.
Wird benutzt von raise().
00606 { 00607 return SetAttr(attr, val); 00608 }

| nomask public int SetTimedAttrModifier | ( | string | key, | |
| mapping | modifier, | |||
| int | outdated, | |||
| object | dependent, | |||
| mixed | notify | |||
| ) |
Definiert in Zeile 51 der Datei attributes.c.
Benutzt attributes_timed_mods, TATTR_DEPENDENT, TATTR_ENTRIES, TATTR_INVALID_ARGS, TATTR_MOD, TATTR_NOTIFY, TATTR_OUTDATE und TATTR_OUTDATED.
00052 { 00053 if(!key || key=="" || !modifier || (outdated>0 && outdated<time()) || 00054 (notify && !stringp(notify) && !objectp(notify)) ) { 00055 return TATTR_INVALID_ARGS; 00056 } 00057 00058 00059 if(member(attributes_timed_mods[TATTR_ENTRIES],key)) { 00060 // change entry 00061 attributes_timed_mods[TATTR_ENTRIES][key,TATTR_MOD]=modifier; 00062 attributes_timed_mods[TATTR_ENTRIES][key,TATTR_OUTDATED]=outdated; 00063 attributes_timed_mods[TATTR_ENTRIES][key,TATTR_DEPENDENT]=dependent; 00064 attributes_timed_mods[TATTR_ENTRIES][key,TATTR_NOTIFY]=notify; 00065 } 00066 else { 00067 // add entry 00068 attributes_timed_mods[TATTR_ENTRIES]+=([key:modifier;outdated;dependent;notify]); 00069 } 00070 00071 // add outdate 00072 if(outdated>0 && member(attributes_timed_mods[TATTR_OUTDATE],outdated)==-1) 00073 { 00074 attributes_timed_mods[TATTR_OUTDATE]+=({outdated}); 00075 attributes_timed_mods[TATTR_OUTDATE]= 00076 sort_array(attributes_timed_mods[TATTR_OUTDATE],#'<); 00077 } 00078 00079 // add dependent 00080 if(objectp(dependent)) 00081 { 00082 if(member(attributes_timed_mods[TATTR_DEPENDENTS],key)) 00083 { 00084 attributes_timed_mods[TATTR_DEPENDENTS][key]=dependent; 00085 } 00086 else 00087 { 00088 attributes_timed_mods[TATTR_DEPENDENTS]+=([key:dependent]); 00089 } 00090 } 00091 else 00092 { 00093 // remove previously set dependent 00094 if(member(attributes_timed_mods[TATTR_DEPENDENTS],key)) 00095 { 00096 attributes_timed_mods[TATTR_DEPENDENTS]-=([key]); 00097 } 00098 } 00099 00100 UpdateAttributes(); 00101 00102 return TATTR_OK; 00103 }
| public status TestLimitViolation | ( | mapping | check | ) |
Definiert in Zeile 615 der Datei attributes.c.
00616 { 00617 int k,test; 00618 mixed* ind; 00619 00620 if(!check || !mappingp(check)) 00621 { 00622 return 0; 00623 } 00624 00625 test=0; 00626 ind=m_indices(check); 00627 for( k=sizeof(ind)-1 ; k>=0 ; k-- ) 00628 { 00629 test+=check[ind[k]]; 00630 } 00631 00632 test+=cumulative_mod; 00633 if(test>CUMULATIVE_ATTR_LIMIT) 00634 { 00635 return 1; 00636 } 00637 00638 return 0; 00639 }
| public void UpdateAttributes | ( | ) |
Definiert in Zeile 447 der Datei attributes.c.
Wird benutzt von InsertSensitiveObject().
00447 { 00448 mixed *ind; 00449 int i; 00450 00451 // alle gueltigen Modifier ermitteln aus Objekten im Inventar. 00452 calculate_valid_modifiers(); 00453 00454 // persistente modifier drauf (frosch zb) 00455 // aus P_ATTRIBUTES_MODIFIERS 00456 if ( mappingp(attributes_modifier) ) { 00457 foreach(mixed key, mapping wert: attributes_modifier) { 00458 add_offsets(wert); // Modifier addieren... 00459 } 00460 } 00461 // timed modifier drauf aus P_TIMED_ATTR_MOD 00462 ind=m_indices(attributes_timed_mods[TATTR_ENTRIES]); 00463 for ( i=sizeof(ind)-1 ; i>=0 ; i-- ) { 00464 // Modifier addieren... 00465 add_offsets(attributes_timed_mods[TATTR_ENTRIES][ind[i],0]); 00466 } 00467 // Bei Monstern werden die HP/SP ueblicherweise selbst gesetzt 00468 if ( !query_once_interactive(this_object())) 00469 return; 00470 00471 SetProp(P_MAX_HP, ((int)QueryAttribute(A_CON))*8+42+hp_off); 00472 SetProp(P_MAX_SP, ((int)QueryAttribute(A_INT))*8+42+sp_off); 00473 00474 if(QueryProp(P_HP)>QueryProp(P_MAX_HP)) { 00475 SetProp(P_HP,QueryProp(P_MAX_HP)); 00476 } 00477 00478 if(QueryProp(P_SP)>QueryProp(P_MAX_SP)) { 00479 SetProp(P_SP,QueryProp(P_MAX_SP)); 00480 } 00481 }

| nosave object* all_modifiers |
Definiert in Zeile 44 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
| mapping attributes |
Definiert in Zeile 39 der Datei attributes.c.
| mapping attributes_modifier |
Definiert in Zeile 40 der Datei attributes.c.
| nosave mapping attributes_offsets |
Definiert in Zeile 42 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
| nosave mixed* attributes_timed_mods |
Definiert in Zeile 41 der Datei attributes.c.
Wird benutzt von SetTimedAttrModifier().
| nosave int cumulative_mod |
Definiert in Zeile 46 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
| nosave int hp_off |
Definiert in Zeile 47 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
| nosave object* invalid_modifiers |
Definiert in Zeile 45 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers() und notifyInvalidModifiers().
| nosave int sp_off |
Definiert in Zeile 48 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers().
| nosave mapping used_attributes_offsets |
Definiert in Zeile 43 der Datei attributes.c.
Wird benutzt von calculate_valid_modifiers() und create().
1.6.3