-
Notifications
You must be signed in to change notification settings - Fork 4
/
item.py
572 lines (468 loc) · 23.3 KB
/
item.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
import random
from Status import DAMAGE_REFLECT_STATUS_DESCRIPTION
from action import Action
from actor import DoNothingActor
from cloud import new_frost_cloud, new_poison_cloud
from compositecore import Leaf, Composite
from graphic import GraphicChar, CharPrinter
from health import ReflectDamageTakenEffect
from item_components import Stacker, \
AddSpoofChildEquipEffect, HealTriggeredEffect, ApplyPoisonTriggeredEffect, CreateFlameCloudTriggeredEffect, \
ApplyFrostTriggeredEffect, ReEquipAction, DropItemTriggeredEffect, \
AddEnergySpentEffect, PutToSleepTriggeredEffect, RemoveItemEffect, FlashItemEffect, LocalMessageEffect, \
TeleportTriggeredEffect, SingleSwapTriggeredEffect, MagicMappingTriggeredEffect, PushOthersTriggeredEffect, \
EquipmentType, PlayerAutoPickUp, ItemType, _item_flash_animation, CreateCloudTriggeredEffect, MoveTriggeredEffect, \
ExplodeTriggeredEffect, RemoveAChargeEffect, DarknessTriggeredEffect, WallToGlassTriggeredEffect, \
HeartStopTriggeredEffect, SwapsTriggeredEffect, ZapRandomSeenEntityTriggeredEffect, HealAllSeenTriggeredEffect, \
BlinksTriggeredEffect, ChooseChargeDeviceTriggeredEffect
import messenger
from missileaction import PlayerThrowItemAction
from mover import Mover
from position import Position, DungeonLevel
from stats import DataPoint, Flag, DataTypes, GamePieceTypes
from text import Description
import action
import colors
import equipment
import gametime
import icon
from equipmenteffect import StatBonusEquipEffect, LifeStealEffect, SetInvisibilityFlagEquippedEffect
from trigger import Trigger
def set_item_components(item, game_state):
item.set_child(DataPoint(DataTypes.ENERGY, -gametime.single_turn))
item.set_child(Position())
item.set_child(DoNothingActor())
item.set_child(DungeonLevel())
item.set_child(Mover())
item.set_child(DataPoint(DataTypes.GAME_PIECE_TYPE, GamePieceTypes.ITEM))
item.set_child(DataPoint(DataTypes.GAME_STATE, game_state))
item.set_child(CharPrinter())
new_drop_action(DROP_ACTION_TAG, item)
item.set_child(PlayerThrowItemAction())
set_thrown_item_hit_floor_action(item, [MoveTriggeredEffect(), LocalMessageEffect(messenger.ITEM_HITS_THE_GROUND_HEAVY)])
set_thrown_item_hit_chasm_action(item, [MoveTriggeredEffect(), LocalMessageEffect(messenger.ITEM_FALLS_DOWN_CHASM)])
return item
def set_device_components(item):
item.set_child(ItemType(ItemType.DEVICE))
item.set_child(PlayerAutoPickUp())
item.set_child(Charge(random.randrange(2, 7)))
item.set_child(DataPoint(DataTypes.WEIGHT, 5))
return item
class Charge(Leaf):
def __init__(self, charges):
super(Charge, self).__init__()
self.component_type = "charge"
self.charges = charges
def new_darkness_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Device of Darkness",
"This ancient device will dim the vision of all creatures on the floor."))
set_device_item_action(device, [DarknessTriggeredEffect(), LocalMessageEffect(messenger.DARKNESS_MESSAGE)])
device.set_child(GraphicChar(None, colors.GREEN, icon.MACHINE))
return device
def new_heart_stop_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Dev. of Heart Stop",
"This ancient device will cause a random creature on the floor to have a heart attack."))
set_device_item_action(device, [HeartStopTriggeredEffect()])
device.set_child(GraphicChar(None, colors.BLUE, icon.MACHINE))
return device
def new_glass_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Dev. of Glassmaking",
"This ancient device will turn all nearby stone into glass."))
set_device_item_action(device, [WallToGlassTriggeredEffect()])
device.set_child(GraphicChar(None, colors.CYAN, icon.MACHINE))
return device
def new_swap_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Device of Swaping",
"This ancient device will swap places with every creature in view."))
set_device_item_action(device, [SwapsTriggeredEffect()])
device.set_child(GraphicChar(None, colors.YELLOW, icon.MACHINE))
return device
def new_zap_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Device of Zapping",
"This ancient device will zap a random creature within view."))
set_device_item_action(device, [ZapRandomSeenEntityTriggeredEffect()])
device.set_child(GraphicChar(None, colors.GRAY, icon.MACHINE))
return device
def new_healing_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Device of Healing",
"This ancient device will heal everything within view."))
set_device_item_action(device, [HealAllSeenTriggeredEffect()])
device.set_child(GraphicChar(None, colors.PINK, icon.MACHINE))
return device
def new_blinks_device(game_state):
device = Composite()
set_item_components(device, game_state)
set_device_components(device)
device.set_child(Description("Device of Blinks",
"This ancient device will repeatedly teleport all creatuers within view short distances."))
set_device_item_action(device, [BlinksTriggeredEffect()])
device.set_child(GraphicChar(None, colors.PURPLE, icon.MACHINE))
return device
def set_device_item_action(item, triggered_effects):
triggered_effects += [action.TriggerAction("Use", 90, [DEVICE_ACTION_TAG, USER_ACTION_TAG])]
item_trigger_effect = Composite(DEVICE_ACTION_TAG)
item_trigger_effect.set_child(FlashItemEffect()) # todo: does this do anything?
item_trigger_effect.set_child(AddEnergySpentEffect())
item_trigger_effect.set_child(RemoveAChargeEffect())
for triggered_effect in triggered_effects:
item_trigger_effect.set_child(triggered_effect)
item_trigger_effect.set_child(DataPoint("item", item))
item.set_child(item_trigger_effect)
def new_energy_sphere(game_state):
"""
A composite component representing a gun ammunition item.
"""
charge = Composite()
set_item_components(charge, game_state)
charge.set_child(ItemType(ItemType.ENERGY_SHPERE))
charge.set_child(Stacker("charge", 5, random.randrange(1, 3)))
charge.set_child(Description("Energy Sphere", "These spheres are used to power ancient devices."))
charge.set_child(GraphicChar(None, colors.LIGHT_ORANGE, icon.BIG_CENTER_DOT))
charge.set_child(DataPoint(DataTypes.WEIGHT, 1))
charge.set_child(PlayerAutoPickUp())
set_use_item_action(CHARGE_ACTION_TAG, charge, [action.TriggerAction("Charge Device", 90, [CHARGE_ACTION_TAG]),
ChooseChargeDeviceTriggeredEffect()])
return charge
device_factories = [new_blinks_device, new_darkness_device, new_glass_device, new_healing_device,
new_swap_device, new_zap_device, new_heart_stop_device]
def new_ammunition(game_state):
"""
A composite component representing a gun ammunition item.
"""
ammo = Composite()
set_item_components(ammo, game_state)
ammo.set_child(ItemType(ItemType.AMMO))
ammo.set_child(Flag("is_ammo"))
ammo.set_child(Stacker("ammo", 10, random.randrange(2, 6)))
ammo.set_child(Description("Gun Bullets",
"These bullets will fit in most guns."))
ammo.set_child(GraphicChar(None, colors.GRAY, icon.AMMO2))
ammo.set_child(DataPoint(DataTypes.WEIGHT, 1))
ammo.set_child(PlayerAutoPickUp())
return ammo
def new_leather_armor(game_state):
"""
A composite component representing a Armor item.
"""
armor = Composite()
set_item_components(armor, game_state)
set_armor_components(armor)
armor.set_child(Description("Leather Armor",
"A worn leather armor. It's old, but should still protect you from some damage."))
armor.set_child(GraphicChar(None, colors.ORANGE_D, icon.ARMOR))
armor.set_child(StatBonusEquipEffect("armor", 2))
armor.set_child(EquipmentType(equipment.EquipmentTypes.ARMOR))
armor.set_child(DataPoint(DataTypes.WEIGHT, 10))
return armor
def new_leather_boots(game_state):
"""
A composite component representing a Boots Armor item.
"""
boots = Composite()
set_item_components(boots, game_state)
set_armor_components(boots)
boots.set_child(Description("Leather Boots",
"A worn pair of boots, dry mud covers most of the leather."))
boots.set_child(DataPoint(DataTypes.WEIGHT, 4))
boots.set_child(GraphicChar(None, colors.ORANGE_D, icon.BOOTS))
boots.set_child(StatBonusEquipEffect("armor", 1))
boots.set_child(EquipmentType(equipment.EquipmentTypes.BOOTS))
return boots
def new_boots_of_running(game_state):
"""
A composite component representing a Boots Armor item.
"""
boots = Composite()
set_item_components(boots, game_state)
set_armor_components(boots)
boots.set_child(Description("Boots of Running",
"A light pair of boots, they make your movement speed faster."))
boots.set_child(DataPoint(DataTypes.WEIGHT, 2))
boots.set_child(GraphicChar(None, colors.GREEN, icon.BOOTS))
boots.set_child(StatBonusEquipEffect("armor", 0))
boots.set_child(EquipmentType(equipment.EquipmentTypes.BOOTS))
boots.set_child(StatBonusEquipEffect(DataTypes.MOVEMENT_SPEED, -gametime.quarter_turn))
return boots
def new_boots_of_sneaking(game_state):
"""
A composite component representing a Boots Armor item.
"""
boots = Composite()
set_item_components(boots, game_state)
set_armor_components(boots)
boots.set_child(Description("Boots of sneaking",
"A smooth pair of boots, they make you more stealthy."))
boots.set_child(DataPoint(DataTypes.WEIGHT, 2))
boots.set_child(GraphicChar(None, colors.BLUE, icon.BOOTS))
boots.set_child(StatBonusEquipEffect("armor", 0))
boots.set_child(StatBonusEquipEffect(DataTypes.STEALTH, 3))
boots.set_child(EquipmentType(equipment.EquipmentTypes.BOOTS))
return boots
def new_leather_cap(game_state):
"""
A composite component representing a Armor item.
"""
cap = Composite()
set_item_components(cap, game_state)
set_armor_components(cap)
cap.set_child(Description("Leather Cap",
"An old cap made out of leather, this should keep some harm away."))
cap.set_child(DataPoint(DataTypes.WEIGHT, 4))
cap.set_child(GraphicChar(None, colors.ORANGE_D, icon.HELM))
cap.set_child(StatBonusEquipEffect("armor", 1))
cap.set_child(EquipmentType(equipment.EquipmentTypes.HEADGEAR))
return cap
def set_ring_components(item):
item.set_child(EquipmentType(equipment.EquipmentTypes.RING))
item.set_child(ItemType(ItemType.JEWELLRY))
item.set_child(ReEquipAction())
item.set_child(DataPoint(DataTypes.WEIGHT, 2))
def set_amulet_components(item):
item.set_child(EquipmentType(equipment.EquipmentTypes.AMULET))
item.set_child(ItemType(ItemType.JEWELLRY))
item.set_child(ReEquipAction())
item.set_child(DataPoint(DataTypes.WEIGHT, 3))
def new_ring_of_invisibility(game_state):
ring = Composite()
set_item_components(ring, game_state)
set_ring_components(ring)
ring.set_child(GraphicChar(None, colors.CYAN, icon.RING))
ring.set_child(SetInvisibilityFlagEquippedEffect())
ring.set_child(Description("Ring of Invisibility",
"The metal is warm to your skin, "
"this ring will make you invisible"))
return ring
def new_ring_of_evasion(game_state):
ring = Composite()
set_item_components(ring, game_state)
set_ring_components(ring)
ring.set_child(GraphicChar(None, colors.GREEN, icon.RING))
ring.set_child(StatBonusEquipEffect("evasion", 3))
ring.set_child(Description("Ring of Evasion",
"The ring is light on your finger, "
"Its magic powers makes it easier for you to dodge attacks."))
return ring
def new_ring_of_stealth(game_state):
ring = Composite()
set_item_components(ring, game_state)
set_ring_components(ring)
ring.set_child(GraphicChar(None, colors.BLUE, icon.RING))
ring.set_child(StatBonusEquipEffect("stealth", 3))
ring.set_child(Description("Ring of Stealth",
"The ring is smooth to your skin, "
"Its magic powers makes it easier for you to sneak past enemies."))
return ring
def new_ring_of_strength(game_state):
ring = Composite()
set_item_components(ring, game_state)
set_ring_components(ring)
ring.set_child(GraphicChar(None, colors.ORANGE, icon.RING))
ring.set_child(StatBonusEquipEffect("strength", 3))
ring.set_child(Description("Ring of Strength",
"The ring feels unnaturally heavy, "
"Its magic powers makes you stronger."))
return ring
def new_amulet_of_reflect_damage(game_state):
amulet = Composite()
set_item_components(amulet, game_state)
set_amulet_components(amulet)
amulet.set_child(GraphicChar(None, colors.CYAN, icon.AMULET))
amulet.set_child(AddSpoofChildEquipEffect(ReflectDamageTakenEffect,
DAMAGE_REFLECT_STATUS_DESCRIPTION))
amulet.set_child(Description("Amulet of Reflection",
"The amulet feels cold and heavy,"
"it is made of enchanted silver, "
"Its magic powers will damage those who hurt you."))
return amulet
def new_amulet_of_life_steal(game_state):
amulet = Composite()
set_item_components(amulet, game_state)
set_amulet_components(amulet)
amulet.set_child(GraphicChar(None, colors.RED, icon.AMULET))
amulet.set_child(LifeStealEffect())
amulet.set_child(Description("Amulet of Vampirism",
"The gem at the center pulsates when blood is near."
"Its magic powers will heal when you see a creature die."))
return amulet
def set_armor_components(item):
item.set_child(ItemType(ItemType.ARMOR))
item.set_child(ReEquipAction())
return item
def set_potion_components(item):
item.set_child(ItemType(ItemType.POTION))
item.set_child(PlayerAutoPickUp())
item.set_child(DataPoint(DataTypes.WEIGHT, 4))
# potion.set_child(Stacker("health_potion", 3))
# Potions
def new_health_potion(game_state):
potion = Composite()
set_item_components(potion, game_state)
set_potion_components(potion)
potion.set_child(GraphicChar(None, colors.PINK, icon.POTION))
set_drink_item_action(potion, [HealTriggeredEffect(10, 15, messenger.HEALTH_POTION_MESSAGE)])
potion.set_child(Description("Potion of Health",
"An unusually thick liquid contained in a glass bottle."
"Drinking from it will heal you."))
set_thrown_item_hit_floor_action(potion, [LocalMessageEffect(messenger.POTION_SMASH_TO_GROUND)])
return potion
def new_poison_potion(game_state):
potion = Composite()
set_item_components(potion, game_state)
set_potion_components(potion)
potion.set_child(GraphicChar(None, colors.GREEN, icon.POTION))
set_drink_item_action(potion, [ApplyPoisonTriggeredEffect(10, 15),
LocalMessageEffect(messenger.POISON_POTION_DRINK_MESSAGE)])
potion.set_child(Description("Potion of Poison",
"An unusually sluggish liquid contained in a glass bottle."
"Drinking from it would poison you."))
set_thrown_item_hit_floor_action(potion, [CreateCloudTriggeredEffect(cloud_factory=new_poison_cloud),
LocalMessageEffect(messenger.POISON_POTION_BREAK_MESSAGE)])
return potion
def new_flame_potion(game_state):
potion = Composite()
set_item_components(potion, game_state)
set_potion_components(potion)
potion.set_child(GraphicChar(None, colors.RED, icon.POTION))
set_drink_item_action(potion, [CreateFlameCloudTriggeredEffect(),
LocalMessageEffect(messenger.FLAME_POTION_DRINK_MESSAGE)])
potion.set_child(Description("Potion of Fire",
"An unusually muddy liquid contained in a glass bottle."
"Drinking from it would burn you badly."))
set_thrown_item_hit_floor_action(potion, [CreateFlameCloudTriggeredEffect(),
LocalMessageEffect(messenger.FLAME_POTION_BREAKS_MESSAGE)])
return potion
def new_frost_potion(game_state):
potion = Composite()
set_item_components(potion, game_state)
set_potion_components(potion)
potion.set_child(GraphicChar(None, colors.BLUE, icon.POTION))
set_drink_item_action(potion, [ApplyFrostTriggeredEffect()])
potion.set_child(Description("Potion of Frost",
"A soapy liquid contained in a glass bottle."
"Drinking from it would freeze you badly."))
set_thrown_item_hit_floor_action(potion, [CreateCloudTriggeredEffect(cloud_factory=new_frost_cloud),
LocalMessageEffect(messenger.FROST_POTION_BREAKS_MESSAGE)])
return potion
def set_drink_item_action(item, triggered_effects):
set_use_up_item_action(DRINK_ACTION_TAG, item, [action.TriggerAction("Drink", 90, [DRINK_ACTION_TAG])] + triggered_effects)
def set_thrown_item_hit_floor_action(item, triggered_effects):
set_use_up_item_action(HIT_FLOOR_ACTION_TAG, item, [Trigger([HIT_FLOOR_ACTION_TAG])] + triggered_effects)
def set_thrown_item_hit_chasm_action(item, triggered_effects):
set_use_up_item_action(HIT_CHASM_ACTION_TAG, item, [Trigger([HIT_CHASM_ACTION_TAG])] + triggered_effects)
potion_factories = [new_health_potion, new_poison_potion, new_flame_potion, new_frost_potion]
# Scrolls
def set_scroll_components(item):
item.set_child(ItemType(ItemType.SCROLL))
item.set_child(PlayerAutoPickUp())
item.set_child(DataPoint(DataTypes.WEIGHT, 1))
item.set_child(GraphicChar(None, colors.CHAMPAGNE, icon.SCROLL))
set_thrown_item_hit_floor_action(item, [MoveTriggeredEffect(), LocalMessageEffect(messenger.ITEM_HITS_THE_GROUND_LIGHT)])
def new_teleport_scroll(game_state):
scroll = Composite()
set_item_components(scroll, game_state)
set_scroll_components(scroll)
set_read_item_action(scroll, [TeleportTriggeredEffect()])
scroll.set_child(Description("Scroll of Teleport",
"A scroll with strange symbols on."
"When read you will appear in a different position."))
return scroll
def new_swap_scroll(game_state):
scroll = Composite()
set_item_components(scroll, game_state)
set_scroll_components(scroll)
set_read_item_action(scroll, [SingleSwapTriggeredEffect()])
scroll.set_child(Description("Scroll of Swap",
"A scroll with strange symbols on"
"When read you will swap position with another creature on the same floor."))
return scroll
def new_push_scroll(game_state):
scroll = Composite()
set_item_components(scroll, game_state)
set_scroll_components(scroll)
set_read_item_action(scroll, [PushOthersTriggeredEffect()])
scroll.set_child(Description("Scroll of Pushing",
"A scroll which will push all seen creatures away from you."))
return scroll
def new_map_scroll(game_state):
scroll = Composite()
set_item_components(scroll, game_state)
set_scroll_components(scroll)
set_read_item_action(scroll, [MagicMappingTriggeredEffect()])
scroll.set_child(Description("Scroll of Magic Mapping",
"A scroll which will make a map of your surroundings."))
return scroll
def new_sleep_scroll(game_state):
scroll = Composite()
set_item_components(scroll, game_state)
set_scroll_components(scroll)
scroll.remove_component_of_type("player_throw_item_action")
set_read_item_action(scroll, [PutToSleepTriggeredEffect()])
scroll.set_child(Description("Scroll of Sleep",
"A scroll which will put all seen creatures to sleep."))
return scroll
def set_read_item_action(item, triggered_effects):
set_use_up_item_action(READ_ACTION_TAG, item, [action.TriggerAction("Read", 90, [READ_ACTION_TAG, USER_ACTION_TAG])] + triggered_effects)
scroll_factories = [new_sleep_scroll, new_map_scroll, new_teleport_scroll, new_swap_scroll]
def set_use_up_item_action(component_type, item, triggered_effects):
triggered_effects.append(RemoveItemEffect())
set_use_item_action(component_type, item, triggered_effects)
def set_use_item_action(component_type, item, triggered_effects):
item_trigger_effect = Composite(component_type)
item_trigger_effect.set_child(FlashItemEffect()) # todo: does this do anything?
item_trigger_effect.set_child(AddEnergySpentEffect())
for triggered_effect in triggered_effects:
item_trigger_effect.set_child(triggered_effect)
item_trigger_effect.set_child(DataPoint("item", item))
item.set_child(item_trigger_effect)
def new_drop_action(component_type, item):
effect = Composite(component_type)
effect.set_child(DropItemTriggeredEffect())
effect.set_child(DataPoint("item", item))
effect.set_child(action.TriggerAction("Drop", 110, [DROP_ACTION_TAG, USER_ACTION_TAG]))
item.set_child(effect)
def new_throw_item_action(component_type, item):
effect = Composite(component_type)
effect.set_child(DropItemTriggeredEffect())
effect.set_child(DataPoint("item", item))
effect.set_child(action.TriggerAction("Throw", 110, [THROW_ACTION_TAG, USER_ACTION_TAG]))
item.set_child(effect)
def new_bomb(game_state):
bomb = Composite()
set_item_components(bomb, game_state)
bomb.set_child(ItemType(ItemType.BOMB))
bomb.set_child(PlayerAutoPickUp())
bomb.set_child(GraphicChar(None, colors.GRAY_D, icon.BOMB))
bomb.set_child(DataPoint(DataTypes.WEIGHT, 4))
bomb.set_child(Description("Bomb",
"A ball filled gunpowder, with a fuse attached."
"Throwing it will cause some serious damage."))
set_thrown_item_hit_floor_action(bomb, [ExplodeTriggeredEffect(),
LocalMessageEffect(messenger.ENTITY_EXPLODES)])
return bomb
USER_ACTION_TAG = "user_action" # An element with this tag will be visible in menus.
READ_ACTION_TAG = "read_action"
DEVICE_ACTION_TAG = "device_action"
CHARGE_ACTION_TAG = "charge_action"
DRINK_ACTION_TAG = "drink_action"
DROP_ACTION_TAG = "drop_action"
THROW_ACTION_TAG = "throw_action"
HIT_FLOOR_ACTION_TAG = "hit_floor_action_tag"
HIT_CHASM_ACTION_TAG = "hit_chasm_action_tag"