|
1039 | 1039 | :flavor "Who is this amazingly good-looking woman? Her stiff, robotic movements make her too clumsy to use a bow, but you hate to see that beautiful face scratched. It feels personal. Maybe there's some way you can just take her out without having to give her a lot of unsightly wounds.") |
1040 | 1040 |
|
1041 | 1041 |
|
| 1042 | +(defclass Dragon [Approacher] |
| 1043 | +
|
| 1044 | + (field-defaults |
| 1045 | + regen-power 0) |
| 1046 | + (setv mutable-fields #("regen_power")) |
| 1047 | +
|
| 1048 | + (setv |
| 1049 | + regen-frequency NotImplemented |
| 1050 | + grow-threshold None |
| 1051 | + grow-stem None |
| 1052 | + regen-limit 16) |
| 1053 | +
|
| 1054 | + (defmeth suffix-dict [] |
| 1055 | + (dict |
| 1056 | + #** (.suffix-dict (super)) |
| 1057 | + :pw @regen-power)) |
| 1058 | + (defmeth info-bullets [] |
| 1059 | + (.info-bullets (super) |
| 1060 | + #("Regeneration power" @regen-power) |
| 1061 | + #("Regeneration frequency" @regen-frequency) |
| 1062 | + #("Growth threshold" @grow-threshold) |
| 1063 | + #("Next life stage" @grow-stem))) |
| 1064 | +
|
| 1065 | + (setv grow-help "adds its regeneration frequency to its regeneration power. If the sum is ≥1, the integer part is removed to add to the monster's HP. Then, if the monster has a growth threshold and its HP is greater or equal, it advances to its next life stage (and loses all regeneration power).") |
| 1066 | +
|
| 1067 | + (defmeth act [] |
| 1068 | + (doc f"Approach and Grow — The monster approaches per `Approach`. Then, it {@grow-help}") |
| 1069 | + (@approach) |
| 1070 | + (@regen)) |
| 1071 | +
|
| 1072 | + (defmeth regen [] |
| 1073 | + (+= @regen-power @regen-frequency) |
| 1074 | + (setv @hp (max |
| 1075 | + @hp |
| 1076 | + (min @regen-limit (+ @hp (pop-integer-part @regen-power))))) |
| 1077 | + (when (and (is-not @grow-threshold None) (>= @hp @grow-threshold)) |
| 1078 | + (@make @pos @grow-stem :hp @hp) |
| 1079 | + (@rm-from-map))) |
| 1080 | +
|
| 1081 | + (setv flavor "Dragons are very, very large reptiles that hatch from eggs and grow stronger at an alarming rate. Their claws are razor-sharp from birth. As an adult, they can spew gouts of super-hot flame.\n\n Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup.")) |
| 1082 | +
|
| 1083 | +(deftile "e " "a dragon egg" Dragon |
| 1084 | + :iq-ix 195 |
| 1085 | + :destruction-points 20 |
| 1086 | +
|
| 1087 | + :regen-frequency (f/ 4 5) |
| 1088 | + :grow-threshold 4 |
| 1089 | + :grow-stem "wyrmling" |
| 1090 | +
|
| 1091 | + :act (meth [] |
| 1092 | + (doc f"Grow — The monster {@grow-help}") |
| 1093 | + (@regen))) |
| 1094 | +
|
| 1095 | +(deftile "D " "a wyrmling" Dragon |
| 1096 | + :color 'brown |
| 1097 | + :iq-ix 196 |
| 1098 | + ; Renamed from IQ's "wyrm" to make its youth more obvious. |
| 1099 | + :destruction-points 50 |
| 1100 | +
|
| 1101 | + :damage-melee 8 |
| 1102 | +
|
| 1103 | + :regen-frequency (f/ 3 5) |
| 1104 | + :grow-threshold 8 |
| 1105 | + :grow-stem "dragon") |
| 1106 | +
|
| 1107 | +(deftile "D " "a dragon" Dragon |
| 1108 | + :iq-ix 197 |
| 1109 | +
|
| 1110 | + :damage-melee 20 |
| 1111 | + :damage-shot 20 |
| 1112 | +
|
| 1113 | + :regen-frequency (f/ 2 5) |
| 1114 | + :destruction-points 250) |
| 1115 | +
|
| 1116 | +
|
1042 | 1117 | ) |
0 commit comments