This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflower_almanac.dsc
68 lines (67 loc) · 3.9 KB
/
flower_almanac.dsc
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
flower_almanac:
type: item
material: book
display name: <&6>Flower Almanac
mechanisms:
hides: all
enchantments:
- unbreaking:1
recipes:
1:
type: shaped
input:
- gold_ingot|string|gold_ingot
- ink_sac/glow_ink_sac/black_dye|book/enchanted_book|feather
- gold_ingot|dandelion/poppy|blue_orchid/allium/azure_bluet/red_tulip/orange_tulip/white_tulip/pink_tulip/oxeye_daisy/cornflower/lily_of_the_valley|gold_ingot
flower_almanac_use:
type: world
debug: false
events:
after player right clicks dandelion|poppy|blue_orchid|allium|azure_bluet|red_tulip|orange_tulip|white_tulip|pink_tulip|oxeye_daisy|cornflower|lily_of_the_valley with:flower_almanac:
- if <context.location.has_flag[exotic_flower]>:
- narrate "<italic>This flower appears to be exotic...<&r><&nl>Name: <&l><context.location.flag[exotic_id]><&r><&nl>Rarity: <context.location.flag[exotic_rarity]>"
- playsound <context.location> sound:item_book_page_turn sound_category:master pitch:0.6
- else:
- define random <util.random.int[1].to[50]>
- if <[random]> != 50 || <context.location.has_flag[almanac_tried]>:
- narrate "<italic>It appears to be a normal flower..."
- playsound <context.location> sound:item_book_page_turn sound_category:master pitch:1.0
- flag <context.location> almanac_tried:true
- stop
- choose <context.location.material.name>:
- case dandelion:
- define flower_color Yellow
- case poppy red_tulip:
- define flower_color Red
- case blue_orchid cornflower:
- define flower_color Blue
- case allium pink_tulip:
- define flower_color Pink
- case azure_bluet lily_of_the_valley white_tulip oxeye_daisy:
- define flower_color White
- case orange_tulip:
- define flower_color Orange
- define random <util.random.int[1].to[100]>
- if <[random]> >= 1 && <[random]> <= 40:
- define flower_type <script[data_flower_types].data_key[common].random[1].get[1]>
- define rarity <&7>Common
- define color <&7>
- else if <[random]> >= 41 && <[random]> <= 70:
- define flower_type <script[data_flower_types].data_key[uncommon].random[1].get[1]>
- define rarity <&a>Uncommon
- define color <&a>
- else if <[random]> >= 71 && <[random]> <= 90:
- define flower_type <script[data_flower_types].data_key[rare].random[1].get[1]>
- define rarity <&b>Rare
- define color <&b>
- else if <[random]> >= 91 && <[random]> <= 100:
- define flower_type <script[data_flower_types].data_key[unique].random[1].get[1]>
- define rarity <&c>Unique
- define color <&c>
- define flower_adjective <script[data_flower_adjectives].data_key[adjectives].random[1].get[1]>
- define name "<[flower_adjective]> <[flower_color]> <[flower_type]>"
- flag <context.location> exotic_flower:true
- flag <context.location> exotic_id:<[name]>
- flag <context.location> exotic_rarity:<[rarity]>
- narrate "<italic>This flower appears to be exotic...<&r><&nl>Name: <&l><[name]><&r><&nl>Rarity: <[rarity]>"
- playsound <context.location> sound:item_book_page_turn sound_category:master pitch:0.6