Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 1 | |
| 2 | QuerySkillAttribute() |
| 3 | ********************* |
| 4 | |
| 5 | |
| 6 | FUNKTION |
| 7 | ======== |
| 8 | |
| 9 | public int QuerySkillAttribute(string atrname) |
| 10 | |
| 11 | |
| 12 | DEFINIERT IN |
| 13 | ============ |
| 14 | |
| 15 | /std/living/skill_attributes.c |
| 16 | |
| 17 | |
| 18 | ARGUMENTE |
| 19 | ========= |
| 20 | |
| 21 | string atrname Name des abzufragenden Attributs |
| 22 | |
| 23 | |
| 24 | BESCHREIBUNG |
| 25 | ============ |
| 26 | |
| 27 | Mit dieser Funktion kann man den Wert bestimmter Attribute |
| 28 | abfragen, dabei werden das abgefragte Attribut, Todesfolgen, |
| 29 | SA_QUALITY und Werte in P_SKILL_ATTRIBUTE_OFFSETS |
| 30 | beruecksichtigt. |
| 31 | |
| 32 | |
| 33 | |
| 34 | Momentane Skills siehe ModifySkillAttribute. |
| 35 | |
| 36 | |
| 37 | RUECKGABEWERT |
| 38 | ============= |
| 39 | |
| 40 | Der Wert des Attributs. Ist nichts bestimmtes gesetzt, wird |
| 41 | der Standardwert 100 zurueckgegeben. |
| 42 | Der Rueckgabewert liegt zwischen 10 bis 1000 (Prozent). |
| 43 | |
| 44 | |
| 45 | BEMERKUNG |
| 46 | ========= |
| 47 | |
| 48 | Die Funktion ist zwar als 'varargs' definiert, gibt man allerdings |
| 49 | keinen Attributnamen an, wird immer 100 zurueckgegeben. |
| 50 | |
| 51 | |
| 52 | BEISPIEL |
| 53 | ======== |
| 54 | |
| 55 | // ein Spieler kann ein Stueck Kaese stibitzen, wenn er schnell |
| 56 | // genug ist ... (15% ueber normal) |
| 57 | if(this_player()->QuerySkillAttribute(SA_SPEED)>=115) { |
| 58 | tell_object(this_player(), |
| 59 | "Du schnappst das Stueck Kaese aus der Falle.\n"); |
| 60 | obj kaese = clone_object(...); |
| 61 | [...] |
| 62 | } else { |
| 63 | mapping amap=map_indices(VALID_ARMOUR_CLASS,#'!); |
| 64 | amap[AT_GLOVE]=100; |
| 65 | tell_object(this_player(), |
| 66 | "Du bist zu langsam und die Falle schnappt hungrig zu.\n"); |
| 67 | this_player()->Defend(random(100), |
| 68 | ({DT_PIERCE, DT_SQUEEZE}), |
| 69 | ([SP_PHYSICAL_ATTACK: 1, |
| 70 | SP_REDUCE_ARMOUR: amap, |
| 71 | SP_SHOW_DAMAGE: 0])); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | SIEHE AUCH |
| 76 | ========== |
| 77 | |
| 78 | Skills Lernen: LearnSkill, ModifySkill, LimitAbility |
| 79 | * Nutzung: UseSpell, UseSkill |
| 80 | * Abfragen: QuerySkill, QuerySkillAbility |
| 81 | * Modifikation: ModifySkillAttribute, |
| 82 | QuerySkillAttributeModifier, RemoveSkillAttributeModifier |
| 83 | * Properties: P_SKILL_ATTRIBUTES, P_SKILL_ATTRIBUTE_OFFSETS |
| 84 | * sonstig: spruchermuedung, skill_info_liste |
| 85 | * Properties: P_NEWSKILLS |
| 86 | |
| 87 | 5. Okt 2011 Gloinson |