Compare commits
28 Commits
aedcb79e6d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 44530c5edf | |||
|
|
3046a7dfa0 | ||
|
|
4ff52e4876 | ||
|
|
a672aee477 | ||
|
|
8549d27f8a | ||
|
|
06de5efa1a | ||
|
|
763eff2db4 | ||
|
|
291a035a47 | ||
| ac204fe207 | |||
| ed27d2c62d | |||
|
|
dcc7f81705 | ||
|
|
7771b9041b | ||
| dd126636c6 | |||
|
|
06445b71fb | ||
| 44ffc2b8d0 | |||
|
|
01a4e7414c | ||
|
|
37268060a2 | ||
| 4dd0e0aa09 | |||
|
|
eef232d8c7 | ||
| a026802854 | |||
|
|
cc904c7137 | ||
|
|
537b5c0d9b | ||
|
|
8292fdb229 | ||
| c8d959506f | |||
|
|
cc1a6076f4 | ||
|
|
56e1d4452d | ||
|
|
8f6dfd4398 | ||
|
|
106735a290 |
@@ -1,5 +1,5 @@
|
||||
# denizen-scripts
|
||||
<img src="https://sakurafalls.net/data/assets/logo/logo-bg-new-rsc2.png" width="300">
|
||||
<img src="https://sakurafalls.net/data/assets/logo/forumlogo4.png" width="180">
|
||||
<img src="https://forum.denizenscript.com/data/assets/logo/logo.png" width="160">
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
This repository contains the *Denizen* `scripts` and `data` folders of SakuraFalls.
|
||||
|
||||
It contains the actual code used on the server at this time. You are free to explore and to
|
||||
use the scripts that our server uses! We believe that gatekeeping roleplaying servers furhter
|
||||
use the scripts that our server uses! We believe that gatekeeping roleplaying servers further
|
||||
only leads to less variety and creativity. We hope that the code here, although just given as
|
||||
is without further instructions, will lead to a new generation of awesome roleplaying servers.
|
||||
|
||||
|
||||
@@ -9,4 +9,5 @@ automoney_world:
|
||||
- if <[time_passed].is_more_than[<duration[30m]>]>:
|
||||
- flag <[player]> automoney_last:<util.time_now>
|
||||
- money give players:<[player]> quantity:500
|
||||
- if <proc[settings_get].context[<[player]>|game_see_auto_money_announcements]>:
|
||||
- narrate format:formats_prefix targets:<[player]> "Thanks for being online! You have received ¥500."
|
||||
|
||||
@@ -378,14 +378,14 @@ chat_command_channelswitch:
|
||||
- define channel <context.args.get[1].to_lowercase>
|
||||
- choose <[channel]>:
|
||||
- case ic:
|
||||
- flag <player> chat_channel:ic
|
||||
- run settings_set def.player:<player> def.key:text_rp_chat_channel def.value:ic
|
||||
- narrate format:formats_prefix "Changed channel to IC."
|
||||
- stop
|
||||
- case ooc:
|
||||
- if <player.has_flag[chat_disableooc]>:
|
||||
- narrate "<&c>You currently have OOC disabled. Use /ooc first to enable it."
|
||||
- stop
|
||||
- flag <player> chat_channel:ooc
|
||||
- run settings_set def.player:<player> def.key:text_rp_chat_channel def.value:oocz
|
||||
- narrate format:formats_prefix "Changed channel to OOC."
|
||||
- stop
|
||||
- narrate "<&c>Unknown channel <[channel]>. Please try: ic, ooc."
|
||||
@@ -414,5 +414,5 @@ chat_command_chatcolor:
|
||||
- if !<proc[chat_allowed_colors].contains[<[color]>]>:
|
||||
- narrate "<&c>You must choose a color from this list: <proc[chat_allowed_colors].comma_separated>"
|
||||
- stop
|
||||
- flag <player> chat_color:<element[&<color[<[color]>].hex>].parse_color>
|
||||
- run settings_set def.player:<player> def.key:text_rp_chat_color def.value:<[color]>
|
||||
- narrate format:formats_prefix "Changed chat color to <element[&<color[<[color]>].hex>].parse_color><[color]>."
|
||||
|
||||
@@ -29,7 +29,8 @@ chat_channel_ooc:
|
||||
script:
|
||||
- define message <[message].strip_color.replace[&\].with[&].unescaped>
|
||||
- define final "<&8>[<&7><&l>OOC<&8>] <proc[chat_special_group].context[<[player]>]><proc[chat_name_ooc].context[<[player]>]><&7>: <&l><[message]>"
|
||||
- narrate targets:<server.online_players.filter_tag[<[filter_value].has_flag[chat_disableooc].not>]> <[final]>
|
||||
- define targets <server.online_players.filter_tag[<[filter_value].has_flag[chat_disableooc].not>]>
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_looc:
|
||||
@@ -39,7 +40,8 @@ chat_channel_looc:
|
||||
script:
|
||||
- define message <[message].strip_color.replace[&\].with[&].unescaped>
|
||||
- define final "<&8>[<&7>LOOC<&8>] <proc[chat_special_group].context[<[player]>]><&7><proc[character_get_name].context[<[player]>]> <proc[chat_name_ooc].context[<[player]>]><&7>: <[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- define targets <[player].location.find_players_within[10]>
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_allowed_colors:
|
||||
@@ -71,6 +73,40 @@ chat_tokenize_actions:
|
||||
- define index <[index].add[1]>
|
||||
- determine <[result].trim>
|
||||
|
||||
chat_channel_check_targets:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- if <[targets].size> <= 1:
|
||||
- if <proc[settings_get].context[<[player]>|text_rp_chat_distance_warning]>:
|
||||
- narrate "<&6>* <&7><&o>It seemed like nobody could hear you." targets:<[player]>
|
||||
|
||||
chat_channel_check_targets_language:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- if <[all].size> <= 1:
|
||||
- if <proc[settings_get].context[<[player]>|text_rp_chat_distance_warning]>:
|
||||
- narrate "<&6>* <&7><&o>It seemed like nobody could hear you." targets:<[player]>
|
||||
|
||||
chat_accessibility_space_message_inject_define:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define space_targets <[targets].filter_tag[<proc[settings_get].context[<[filter_value]>|accessibility_rp_chat_space_messages]>]>
|
||||
|
||||
chat_accessibility_space_message_inject_define_language:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define space_targets <[all].filter_tag[<proc[settings_get].context[<[filter_value]>|accessibility_rp_chat_space_messages]>]>
|
||||
|
||||
chat_accessibility_space_message_inject_apply:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- narrate targets:<[space_targets]> <&f>
|
||||
|
||||
chat_channel_ic:
|
||||
debug: false
|
||||
type: task
|
||||
@@ -84,9 +120,14 @@ chat_channel_ic:
|
||||
- stop
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|<player.flag[chat_color].if_null[<&e>]>says<&7>:|<player.flag[chat_color].if_null[<&e>]>|<&f>|<&f><&dq><&f>|false].replace[&\].with[&].unescaped>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|<element[&<color[<proc[settings_get].context[<[player]>|text_rp_chat_color]>].hex>].parse_color>says<&7>:|<element[&<color[<proc[settings_get].context[<[player]>|text_rp_chat_color]>].hex>].parse_color>|<&f>|<&f><&dq><&f>|false].replace[&\].with[&].unescaped>
|
||||
- define final "<&color[#b8b9ba]><placeholder[essentials_nickname].player[<[player]>]> <&f><proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- define targets <[player].location.find_players_within[10]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_me:
|
||||
@@ -97,8 +138,13 @@ chat_channel_ic_me:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>*** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- define final "<&e>*** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <element[&<color[<proc[settings_get].context[<[player]>|text_rp_chat_color]>].hex>].parse_color><&o><[message]>"
|
||||
- define targets <[player].location.find_players_within[10]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_mec:
|
||||
@@ -109,8 +155,13 @@ chat_channel_ic_mec:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>* <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- define final "<&e>* <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <element[&<color[<proc[settings_get].context[<[player]>|text_rp_chat_color]>].hex>].parse_color><&o><[message]>"
|
||||
- define targets <[player].location.find_players_within[3]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_mel:
|
||||
@@ -121,8 +172,13 @@ chat_channel_ic_mel:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>**** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- define final "<&e>**** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <element[&<color[<proc[settings_get].context[<[player]>|text_rp_chat_color]>].hex>].parse_color><&o><[message]>"
|
||||
- define targets <[player].location.find_players_within[25]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_whisper:
|
||||
@@ -140,7 +196,12 @@ chat_channel_ic_whisper:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|whispers|<&8>|<&7>|<&6><&sq>|false].replace[&\].with[&].unescaped>
|
||||
- define final "<&color[#d1d1d1]><placeholder[essentials_nickname].player[<[player]>]> <&f><proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- define targets <[player].location.find_players_within[3]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_yell:
|
||||
@@ -158,7 +219,11 @@ chat_channel_ic_yell:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|yells|<&6>|<&f>|<&6><&sq>|true].replace[&\].with[&].unescaped>
|
||||
- define final "<&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- define targets <[player].location.find_players_within[25]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_my:
|
||||
@@ -175,7 +240,11 @@ chat_channel_ic_my:
|
||||
- else:
|
||||
- define possession_name <[possession_name]><&sq>s
|
||||
- define final "<&e>*** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <[possession_name]> <&f><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- define targets <[player].location.find_players_within[10]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_it:
|
||||
@@ -187,7 +256,11 @@ chat_channel_ic_it:
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>*** <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- define targets <[player].location.find_players_within[10]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_itc:
|
||||
@@ -199,7 +272,11 @@ chat_channel_ic_itc:
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>* <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- define targets <[player].location.find_players_within[3]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_itl:
|
||||
@@ -211,7 +288,11 @@ chat_channel_ic_itl:
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>**** <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- define targets <[player].location.find_players_within[25]>
|
||||
- inject chat_accessibility_space_message_inject_define
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- narrate targets:<[targets]> <[final]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_language:
|
||||
@@ -225,10 +306,14 @@ chat_channel_ic_language:
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&f>]>says <&f><&dq><&o><[message]><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&f>]>says something in <[language]>"
|
||||
- define all <[player].location.find_players_within[10]>
|
||||
- inject chat_accessibility_space_message_inject_define_language
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets_language
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final_known]>
|
||||
|
||||
chat_channel_ic_languagewhisper:
|
||||
@@ -242,10 +327,14 @@ chat_channel_ic_languagewhisper:
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>whispers <&dq><&o><[message]><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>whispers something in <[language]>"
|
||||
- define all <[player].location.find_players_within[3]>
|
||||
- inject chat_accessibility_space_message_inject_define_language
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets_language
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final_known]>
|
||||
|
||||
chat_channel_ic_languageyell:
|
||||
@@ -259,8 +348,12 @@ chat_channel_ic_languageyell:
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>yells <&dq><&o><[message].to_uppercase><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>yells something in <[language]>"
|
||||
- define all <[player].location.find_players_within[25]>
|
||||
- inject chat_accessibility_space_message_inject_define_language
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- inject chat_channel_check_targets_language
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- inject chat_accessibility_space_message_inject_apply
|
||||
- announce to_console <[final_known]>
|
||||
|
||||
@@ -4,8 +4,13 @@ chat_world:
|
||||
events:
|
||||
on player chats:
|
||||
- determine cancelled passively
|
||||
- define channel <player.flag[chat_channel].if_null[ic]>
|
||||
- define channel <proc[settings_get].context[<player>|text_rp_chat_channel]>
|
||||
- if <[channel]> == ic:
|
||||
- run chat_channel_ic def.player:<player> def.message:<context.message.parse_color.escaped.replace[&].with[&\]>
|
||||
- else if <[channel]> == ooc:
|
||||
- run chat_channel_ooc def.player:<player> def.message:<context.message.escaped.replace[&].with[&\]>
|
||||
on player receives message:
|
||||
## yes, we will sync the chat thread and live dangerously
|
||||
# manual settings_get because this event is very finnicky and dangerous
|
||||
- if <player.flag[settings].get[accessibility_chat_disable_colors].if_null[false]>:
|
||||
- determine MESSAGE:<context.message.strip_color>
|
||||
|
||||
@@ -40,6 +40,9 @@ furniture_config:
|
||||
iron_horse_armor,7:
|
||||
represents: Clipboard
|
||||
collision: warped_trapdoor
|
||||
iron_horse_armor,8:
|
||||
represents: Vending Machine
|
||||
collision: barrier
|
||||
# List of collision blocks - disables interaction without perms
|
||||
collision_blocks:
|
||||
#- skeleton_skull
|
||||
|
||||
@@ -20,17 +20,16 @@ guns_world_gun:
|
||||
- if !<player.item_in_hand.has_flag[guns_gun]>:
|
||||
- stop
|
||||
- ratelimit <player> 1s
|
||||
# - playsound <player.location> custom sound:your_custom_sound
|
||||
- playsound <player.location> sound:entity_arrow_shoot
|
||||
- define target <player.precise_target[25]||null>
|
||||
- playsound <player.location> custom sound:item.anaconda
|
||||
- define target <player.precise_target[25].if_null[null]>
|
||||
- if <[target]> == null:
|
||||
- define location <player.cursor_on[25]||null>
|
||||
- define location <player.cursor_on[25].if_null[null]>
|
||||
- if <[location]> == null:
|
||||
- define location <player.location.forward[25]>
|
||||
- playeffect effect:redstone at:<player.location.above[1].points_between[<[location]>].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0
|
||||
- stop
|
||||
- playeffect effect:redstone at:<player.location.above[1].points_between[<[target].location.above[1]>].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0
|
||||
- if <[target].type> != player:
|
||||
- if !<[target].is_player>:
|
||||
- stop
|
||||
- if <[target].has_flag[guns_frozen]>:
|
||||
- stop
|
||||
@@ -51,13 +50,12 @@ guns_world_taser:
|
||||
- define target <player.precise_target[7]||null>
|
||||
- if <[target]> == null:
|
||||
- stop
|
||||
- if <[target].type> != player:
|
||||
- if !<[target].is_player>:
|
||||
- stop
|
||||
- if <[target].has_flag[guns_frozen]>:
|
||||
- stop
|
||||
- playeffect effect:redstone at:<player.location.above[1].points_between[<[target].location.above[1]>].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0
|
||||
# - playsound <player.location> custom sound:your_custom_sound
|
||||
- playsound <player.location> sound:entity_armor_stand_hit
|
||||
- playsound <player.location> custom sound:item.taser
|
||||
- animate <[target]> animation:sit
|
||||
- flag <[target]> guns_frozen:true
|
||||
- run guns_unfreeze path:script def:<[target]>
|
||||
|
||||
@@ -18,8 +18,15 @@ ball_create:
|
||||
- spawn slime[silent=true;size=<[size]>;has_ai=false;visible=false] <[location].with_pitch[0].with_yaw[0]> save:ball_collision
|
||||
- define ball_collision <entry[ball_collision].spawned_entity>
|
||||
- define size <[ball_collision].bounding_box.get[1].sub[<[ball_collision].location>].x.abs.add[0.01]>
|
||||
- spawn armor_stand[invulnerable=true;has_ai=false;gravity=false;visible=false] <[location].with_pitch[0].with_yaw[0].below[<[size].add[1]>]> save:ball_display
|
||||
- spawn zombie[silent=true;has_ai=false;gravity=false;visible=false] <[location].with_pitch[0].with_yaw[0].below[<[size].add[1]>]> save:ball_display
|
||||
- define ball_display <entry[ball_display].spawned_entity>
|
||||
- if <[ball_display].is_baby>:
|
||||
- age <[ball_display]> adult lock
|
||||
- if <[ball_display].is_inside_vehicle>:
|
||||
# CHICKEN JOCKEEEEEEEEEEEEEEEEEEEEEEEEEY
|
||||
- define chicken <[ball_display].vehicle>
|
||||
- adjust <[chicken]> passengers:<list[]>
|
||||
- remove <[chicken]>
|
||||
- adjust <[ball_display]> equipment:<map[].with[helmet].as[<[display_item]>]>
|
||||
- flag <[ball_collision]> ball:<[id]>
|
||||
- flag <[ball_collision]> ball_display:<[ball_display]>
|
||||
@@ -142,8 +149,5 @@ ball_internal_physics_update_ball:
|
||||
- define next <[changes].get[1].if_null[<[next]>]>
|
||||
- define velocity <[changes].get[2].if_null[<[velocity]>]>
|
||||
- flag <[ball]> ball_velocity:<[velocity]>
|
||||
- if <[size]> <= 2:
|
||||
- teleport <[ball].flag[ball_display]> <[next].below[<[size].add[0.7]>]>
|
||||
- else:
|
||||
- teleport <[ball].flag[ball_display]> <[next].below[<[size].add[0.7]>]>
|
||||
- teleport <[ball].flag[ball_display]> <[ball].bounding_box.get[1].add[<[ball].bounding_box.get[2]>].div[2].below[1.575].below[0.125]>
|
||||
- teleport <[ball]> <[next]>
|
||||
|
||||
309
scripts/lib/cutscene.dsc
Normal file
309
scripts/lib/cutscene.dsc
Normal file
@@ -0,0 +1,309 @@
|
||||
#
|
||||
# Cutscene - library for creating cool cutscenes similar to the Replay Mod
|
||||
#
|
||||
# Playing cutscenes can also be atomic, meaning that if the player leaves mid
|
||||
# cutscene, the cutscene may interrupt the queue that called the task in order
|
||||
# to prevent the script from continuing.
|
||||
|
||||
# Determines the set of points passing through the given points spaced by the given distance.
|
||||
# Effectively, the points representing the lines going from p0 to p1, then p1 to p2, etc...
|
||||
# The points have to be given escaped! So <[myinput].escaped>!
|
||||
cutscene_concatenate_points_between:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: points|distance
|
||||
script:
|
||||
- define points <[points].unescaped>
|
||||
- define result <list[]>
|
||||
- repeat <[points].size.sub[1]> as:index:
|
||||
- define result <[result].include[<[points].get[<[index]>].points_between[<[points].get[<[index].add[1]>]>].distance[<[distance]>]>]>
|
||||
- determine <[result]>
|
||||
|
||||
# Determines the Catmull-Rom spline passing through the given points, taking the distance
|
||||
# between the resulting equidistant points and the resolution of the computation into account.
|
||||
# Note that the efficiency of this algorithm is not amazing necessarily, so you should cache
|
||||
# the results. Higher resolutions also mean the algorithm will take longer to finish.
|
||||
# The points have to be given escaped! So <[myinput].escaped>!
|
||||
cutscene_catmull_rom_equidistant_spline:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: points|distance|resolution
|
||||
script:
|
||||
- define points <[points].unescaped>
|
||||
- define distance <[distance].if_null[0.25]>
|
||||
- define resolution <[resolution].if_null[100]>
|
||||
- if <[points].size> < 2:
|
||||
- determine <[points]>
|
||||
- if <[points].size> == 2:
|
||||
- determine <[points].get[1].points_between[<[points].get[2]>].distance[<[distance]>]>
|
||||
- define spline_points <list[]>
|
||||
- define cumulative_distances <list[<element[0]>]>
|
||||
- repeat <[points].size.sub[1]> from:0 as:segment_index:
|
||||
- if <[segment_index]> == 0:
|
||||
- define p0 <[points].get[1].sub[<[points].get[2].sub[<[points].get[1]>]>]>
|
||||
- define p1 <[points].get[1]>
|
||||
- define p2 <[points].get[2]>
|
||||
- define p3 <tern[<[points].size.is_more_than[2]>].pass[<[points].get[3]>].fail[<[points].get[2]>]>
|
||||
- else if <[segment_index]> == <[points].size.sub[2]>:
|
||||
- define p0 <[points].get[<[segment_index]>]>
|
||||
- define p1 <[points].get[<[segment_index].add[1]>]>
|
||||
- define p2 <[points].get[<[segment_index].add[2]>]>
|
||||
- define p3 <[points].get[<[segment_index].add[2]>].add[<[points].get[<[segment_index].add[2]>].sub[<[points].get[<[segment_index].add[1]>]>]>]>
|
||||
- else:
|
||||
- define p0 <[points].get[<[segment_index]>]>
|
||||
- define p1 <[points].get[<[segment_index].add[1]>]>
|
||||
- define p2 <[points].get[<[segment_index].add[2]>]>
|
||||
- define p3 <[points].get[<[segment_index].add[3]>]>
|
||||
- define t 0
|
||||
- while <[t]> < 1:
|
||||
- define t2 <[t].mul[<[t]>]>
|
||||
- define t3 <[t2].mul[<[t]>]>
|
||||
- define px <element[0.5].mul[<[p1].x.mul[2].add[<[p2].x.sub[<[p0].x>].mul[<[t]>]>].add[<[p0].x.mul[2].sub[<[p1].x.mul[5]>].add[<[p2].x.mul[4]>].sub[<[p3].x>].mul[<[t2]>]>].add[<[p0].x.mul[-1].add[<[p1].x.mul[3]>].sub[<[p2].x.mul[3]>].add[<[p3].x>].mul[<[t3]>]>]>]>
|
||||
- define py <element[0.5].mul[<[p1].y.mul[2].add[<[p2].y.sub[<[p0].y>].mul[<[t]>]>].add[<[p0].y.mul[2].sub[<[p1].y.mul[5]>].add[<[p2].y.mul[4]>].sub[<[p3].y>].mul[<[t2]>]>].add[<[p0].y.mul[-1].add[<[p1].y.mul[3]>].sub[<[p2].y.mul[3]>].add[<[p3].y>].mul[<[t3]>]>]>]>
|
||||
- define pz <element[0.5].mul[<[p1].z.mul[2].add[<[p2].z.sub[<[p0].z>].mul[<[t]>]>].add[<[p0].z.mul[2].sub[<[p1].z.mul[5]>].add[<[p2].z.mul[4]>].sub[<[p3].z>].mul[<[t2]>]>].add[<[p0].z.mul[-1].add[<[p1].z.mul[3]>].sub[<[p2].z.mul[3]>].add[<[p3].z>].mul[<[t3]>]>]>]>
|
||||
- define point <location[<[px]>,<[py]>,<[pz]>,<[points].get[1].world.name>]>
|
||||
- if <[spline_points].size> > 0:
|
||||
- define last_point <[spline_points].get[-1]>
|
||||
- define cumulative_distance <[last_point].distance[<[point]>]>
|
||||
- define cumulative_distances <[cumulative_distances].include[<[cumulative_distances].get[-1].add[<[cumulative_distance]>]>]>
|
||||
- define spline_points <[spline_points].include[<[point]>]>
|
||||
- define t <[t].add[<element[1].div[<[resolution]>]>]>
|
||||
- define equidistant_points <list[<[spline_points].get[1]>]>
|
||||
- define total_length <[cumulative_distances].get[-1]>
|
||||
- define current_distance 0
|
||||
- define current_index 1
|
||||
- while <[current_distance]> < <[total_length]>:
|
||||
- define target_distance <[current_distance].add[<[distance]>]>
|
||||
- if <[target_distance]> > <[total_length]>:
|
||||
- while stop
|
||||
- while <[current_index]> < <[cumulative_distances].size> && <[cumulative_distances].get[<[current_index].add[1]>]> < <[target_distance]>:
|
||||
- define current_index <[current_index].add[1]>
|
||||
- define t1 <[cumulative_distances].get[<[current_index]>]>
|
||||
- define t2 <[cumulative_distances].get[<[current_index].add[1]>]>
|
||||
- define alpha <[target_distance].sub[<[t1]>].div[<[t2].sub[<[t1]>]>]>
|
||||
- define p1 <[spline_points].get[<[current_index]>]>
|
||||
- define p2 <[spline_points].get[<[current_index].add[1]>]>
|
||||
- define x <[p1].x.add[<[alpha].mul[<[p2].x.sub[<[p1].x>]>]>]>
|
||||
- define y <[p1].y.add[<[alpha].mul[<[p2].y.sub[<[p1].y>]>]>]>
|
||||
- define z <[p1].z.add[<[alpha].mul[<[p2].z.sub[<[p1].z>]>]>]>
|
||||
- define point <location[<[x]>,<[y]>,<[z]>,<[points].get[1].world.name>]>
|
||||
- define equidistant_points <[equidistant_points].include[<[point]>]>
|
||||
- define current_distance <[target_distance]>
|
||||
- define last_control_point <[points].get[-1]>
|
||||
- define last_generated <[equidistant_points].get[-1]>
|
||||
- if <[last_generated].distance[<[last_control_point]>]> >= <[distance].div[2]>:
|
||||
- define equidistant_points <[equidistant_points].include[<[last_control_point]>]>
|
||||
- determine <[equidistant_points]>
|
||||
|
||||
# Previews the given path for the given player, where the source definition are the points that
|
||||
# the resulting path must pass through, for the specified duration_tag. Note for the duration_tag
|
||||
# that a <duration[]> is required, and it will not work if using simple <element[]>, like '5s'.
|
||||
cutscene_preview_path:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|source|result|duration_tag
|
||||
script:
|
||||
- define duration_tag <[duration_tag].if_null[<duration[5s]>]>
|
||||
- define now <util.current_time_millis>
|
||||
- while <util.current_time_millis.sub[<[now]>]> < <[duration_tag].in_milliseconds>:
|
||||
- if !<[player].is_online>:
|
||||
- stop
|
||||
- playeffect at:<[source]> targets:<[player]> effect:CLOUD offset:0,0,0 quantity:1 velocity:0,0,0 visibility:1000
|
||||
- playeffect at:<[result]> targets:<[player]> effect:ENCHANTED_HIT offset:0,0,0 quantity:1 velocity:0,0,0 visibility:1000
|
||||
- wait 5t
|
||||
|
||||
# Simple linear interpolation.
|
||||
# Given as parameter to cutscene_follow_path_by_interpolation.
|
||||
cutscene_interpolate_linear:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: step
|
||||
script:
|
||||
- determine 0.5
|
||||
|
||||
# Ease in interpolation.
|
||||
# Given as parameter to cutscene_follow_path_by_interpolation.
|
||||
cutscene_interpolate_ease_in:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: step
|
||||
script:
|
||||
- determine <[step].mul[<util.pi.div[2]>].sin>
|
||||
|
||||
# Ease out interpolation.
|
||||
# Given as parameter to cutscene_follow_path_by_interpolation.
|
||||
cutscene_interpolate_ease_out:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: step
|
||||
script:
|
||||
- determine <[step].mul[<util.pi.div[2]>].add[<util.pi.div[2]>].sin>
|
||||
|
||||
|
||||
# Ease in-out interpolation.
|
||||
# Given as parameter to cutscene_follow_path_by_interpolation.
|
||||
cutscene_interpolate_ease_in_out:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: step
|
||||
script:
|
||||
- determine <[step].mul[<util.pi>].sin>
|
||||
|
||||
# Makes the player follow the given path at the given speed, using the provided interpolation.
|
||||
# Note that the speed is an arbitrary construct, but higher numbers will make the player follow
|
||||
# the path faster.
|
||||
cutscene_follow_path_by_interpolation:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|path|look_at|speed|interpolation_procedure
|
||||
script:
|
||||
- if <[path].size> == 0:
|
||||
- stop
|
||||
- define look_at_is_list <tern[<[look_at].get[1].if_null[null].equals[null]>].pass[false].fail[true]>
|
||||
- teleport <[player]> <[path].get[1]>
|
||||
- define time_unit <[path].size.div[<[speed].mul[20]>]>
|
||||
- define should_await_time 0
|
||||
- define index 1
|
||||
- while <[index]> < <[path].size>:
|
||||
- define point <[path].get[<[index]>]>
|
||||
- define step <[index].sub[1].div[<[path].size>]>
|
||||
- define await_time <element[1].sub[<proc[<[interpolation_procedure]>].context[<[step]>]>].mul[<[time_unit]>]>
|
||||
- define should_await_time <[should_await_time].add[<[await_time]>]>
|
||||
- if <[should_await_time]> < 1:
|
||||
- define index <[index].add[1]>
|
||||
- while next
|
||||
- wait <[should_await_time].round_down>t
|
||||
- define should_await_time <[should_await_time].sub[<[should_await_time].round_down>]>
|
||||
- define direction <[look_at].sub[<[point]>].normalize>
|
||||
- define quaternion_pitch <[direction].quaternion_between_vectors[0,1,0].represented_angle.sub[<util.pi.div[2]>].to_degrees>
|
||||
- define result_point <[point].with_pitch[<[quaternion_pitch]>].with_yaw[<[point].direction[<[look_at]>].yaw>]>
|
||||
- if !<[player].is_online>:
|
||||
- determine false
|
||||
- teleport <[player]> <[result_point].add[0,-1,0]> offthread_repeat:8
|
||||
- define index <[index].add[1]>
|
||||
- if !<[player].is_online>:
|
||||
- determine false
|
||||
- teleport <[player]> <[path].get[-1]>
|
||||
- determine true
|
||||
|
||||
# Creates and saves a cutscene.
|
||||
# Definitions explanation:
|
||||
# - name: The name of the cutscene. Must be unique, case sensitive.
|
||||
# - points: The source points to generate the path from.
|
||||
# - look_at: The location that the player should look at throughout the entire path follow
|
||||
# - compute_spline: Whether to use straight lines for the path, or to compute a smooth spline.
|
||||
# - interpolation_procedure: A procedure to interpolate the speed of the path follower.
|
||||
#
|
||||
# If the cutscene already exists, it will not create it and silently fail.
|
||||
# Determines true if the cutscene was created, or false if it already exists.
|
||||
cutscene_create_and_save:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: name|points|look_at|speed|compute_spline|interpolation_procedure
|
||||
script:
|
||||
- if <server.flag[cutscene].if_null[<map[]>].contains[<[name]>]>:
|
||||
- determine false
|
||||
- if !<[compute_spline]>:
|
||||
- define result <proc[cutscene_concatenate_points_between].context[<[points].escaped>|0.33]>
|
||||
- else:
|
||||
- define result <proc[cutscene_catmull_rom_equidistant_spline].context[<[points].escaped>|0.33|50]>
|
||||
- definemap cutscene:
|
||||
name: <[name]>
|
||||
source: <[points]>
|
||||
result: <[result]>
|
||||
look_at: <[look_at]>
|
||||
speed: <[speed]>
|
||||
interpolation_procedure: <[interpolation_procedure]>
|
||||
- flag server cutscene:<server.flag[cutscene].if_null[<map[]>].with[<[name]>].as[<[cutscene]>]>
|
||||
- determine true
|
||||
|
||||
# Destroys an existing cutscnee.
|
||||
# If the cutscene doesn't exist, it will fail silently.
|
||||
# Determines true if the cutscene was destroyed, or false if it did not yet exist.
|
||||
cutscene_destroy:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: name
|
||||
script:
|
||||
- if !<server.flag[cutscene].if_null[<map[]>].contains[<[name]>]>:
|
||||
- determine false
|
||||
- flag server cutscene:<server.flag[cutscene].if_null[<map[]>].exclude[<[name]>]>
|
||||
- determine false
|
||||
|
||||
# Previews the given path for the given player, using a saved cutscene as the source.
|
||||
# Note for the duration_tag that a <duration[]> is required, and it will not work if
|
||||
# using simple <element[]>, like '5s'.
|
||||
cutscene_preview_path_by_name:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: name|player|duration_tag
|
||||
script:
|
||||
- if !<server.flag[cutscene].if_null[<map[]>].contains[<[name]>]>:
|
||||
- debug error "Cannot preview path by name! <[name]> @ <[player]>"
|
||||
- stop
|
||||
- define cutscene <server.flag[cutscene].get[<[name]>]>
|
||||
- run cutscene_preview_path def.player:<[player]> def.source:<[cutscene].get[source]> def.result:<[cutscene].get[result]> def.duration_tag:<[duration_tag]>
|
||||
|
||||
# Plays the given cutscene by name.
|
||||
# If the player disconnects, the cutscene will stop playing, but the queue that
|
||||
# called this task will continue. Consider cutscene_play_atomic in case you would
|
||||
# like to stop the queue that called this task.
|
||||
# Determines true if the cutscene completed, false otherwise.
|
||||
# Should be ~waited for.
|
||||
cutscene_play:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: name|player
|
||||
script:
|
||||
- run cutscene_stop def.player:<[player]>
|
||||
- if !<server.flag[cutscene].if_null[<map[]>].contains[<[name]>]>:
|
||||
- determine false
|
||||
- define cutscene <server.flag[cutscene].get[<[name]>]>
|
||||
- flag <[player]> cutscene:<map[].with[gamemode].as[<player.gamemode>].with[location].as[<player.location>]>
|
||||
- adjust <[player]> gamemode:spectator
|
||||
- run cutscene_follow_path_by_interpolation def.player:<[player]> def.path:<[cutscene].get[result]> def.look_at:<[cutscene].get[look_at]> def.speed:<[cutscene].get[speed]> def.interpolation_procedure:<[cutscene].get[interpolation_procedure]> save:result
|
||||
- define queue <entry[result].created_queue>
|
||||
- flag <[player]> cutscene_queue:<[queue]>
|
||||
- waituntil <[queue].state.equals[running]> max:5t
|
||||
- waituntil <[queue].state.equals[running].not>
|
||||
- define ok <[queue].determination.get[1]>
|
||||
- run cutscene_stop def.player:<player>
|
||||
- determine <[ok]>
|
||||
|
||||
# Plays the cutscene atomically.
|
||||
# See cutscene_play for an explanation.
|
||||
# Should be ~waited for.
|
||||
cutscene_play_atomic:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: name|player|queue
|
||||
script:
|
||||
- ~run cutscene_play def.name:<[name]> def.player:<[player]> save:result
|
||||
- define result <entry[result].created_queue.determination.get[1]>
|
||||
- if !<[result].if_null[false]>:
|
||||
- debug log "Cancelled atomic cutscene: <[player].name> @ <[name]>"
|
||||
- queue stop <[queue]>
|
||||
|
||||
# Stops the currently playing cutscene from playing.
|
||||
# If no cutscene is playing, it silently fails.
|
||||
cutscene_stop:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player
|
||||
script:
|
||||
- if !<[player].has_flag[cutscene]>:
|
||||
- stop
|
||||
- define save <[player].flag[cutscene]>
|
||||
- if <[player].flag[cutscene_queue]> != null:
|
||||
- queue stop <[player].flag[cutscene_queue]>
|
||||
- adjust <[player]> gamemode:<[save].get[gamemode]>
|
||||
- teleport <[player]> <[save].get[location]>
|
||||
- flag <[player]> cutscene:!
|
||||
|
||||
## Internal only!
|
||||
cutscene_world:
|
||||
debug: false
|
||||
type: world
|
||||
events:
|
||||
on player joins:
|
||||
- run cutscene_stop def.player:<player>
|
||||
@@ -35,7 +35,7 @@ textbox_write:
|
||||
- queue stop <[queue]>
|
||||
- run textbox_flush def.player:<[player]>
|
||||
- stop
|
||||
- define lines <[line3s].split[$$nl].parse_tag[<[parse_value].trim>]>
|
||||
- define lines <[line3s].split[$$nl].parse_tag[<[parse_value].trim.replace[<&0>].with[<&6>]>]>
|
||||
- flag <[player]> textbox_state:writing
|
||||
- flag <[player]> textbox_input:<[lines]>
|
||||
- flag <[player]> textbox_lines:<[lines].size>
|
||||
@@ -44,6 +44,7 @@ textbox_write:
|
||||
- bossbar create textbox_<[player].uuid>_2 players:<[player]> title:<empty>
|
||||
- bossbar create textbox_<[player].uuid>_3 players:<[player]> title:<empty>
|
||||
- wait 1t
|
||||
- define write_speed <proc[settings_get].context[<[player]>|text_textbox_write_speed].if_null[1]>
|
||||
- if <[avatar_unicode]> != null:
|
||||
- bossbar create textbox_<[player].uuid>_avatar players:<[player]> title:<element[ ].repeat[64]><[avatar_unicode]>
|
||||
- foreach <[lines]> as:line:
|
||||
@@ -56,22 +57,22 @@ textbox_write:
|
||||
- stop
|
||||
- if !<[player].is_online>:
|
||||
- stop
|
||||
- bossbar update textbox_<[player].uuid>_<[loop_index]> title:<black><bold><[line].substring[1,<[value]>]>
|
||||
- bossbar update textbox_<[player].uuid>_<[loop_index]> title:<&6><&l><[line].substring[1,<[value]>]>
|
||||
- if <[value].sub[1].mod[3]> == 0:
|
||||
- playsound sound:textbox.text <[player]> custom pitch:<util.random.decimal[0.98].to[1]>
|
||||
- wait 1t
|
||||
- playsound sound:textbox.text <[player]> custom pitch:<util.random.decimal[0.98].to[1]> volume:<proc[settings_get].context[<[player]>|sound_textbox_volume].div[100].if_null[1]>
|
||||
- wait <[write_speed]>t
|
||||
- if <[line].substring[<[value].add[1]>,<[value].add[1]>].trim.length.if_null[1]> == 0:
|
||||
- if <[line].substring[<[value]>,<[value]>]> == .:
|
||||
- wait 2t
|
||||
- wait <[write_speed].add[1]>t
|
||||
- if <[line].substring[<[value]>,<[value]>]> == !:
|
||||
- wait 2t
|
||||
- wait <[write_speed].add[1]>t
|
||||
- if <[line].substring[<[value]>,<[value]>]> == ?:
|
||||
- wait 2t
|
||||
- wait <[write_speed].add[1]>t
|
||||
- if <[line].substring[<[value]>,<[value]>]> == -:
|
||||
- wait 2t
|
||||
- wait <[write_speed].add[1]>t
|
||||
- if <[line].substring[<[value]>,<[value]>]> == ,:
|
||||
- wait 2t
|
||||
- wait <duration[1t]>
|
||||
- wait <[write_speed].add[1]>t
|
||||
- wait <duration[<[write_speed]>t]>
|
||||
- if <[player].flag[textbox_state].if_null[null]> != writing:
|
||||
- if <[queue].if_null[null]> != null && <[player].flag[textbox_state].if_null[null]> != continue:
|
||||
- debug log "[Textbox] Write; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; state mismatch."
|
||||
@@ -99,7 +100,7 @@ textbox_skip:
|
||||
- bossbar create textbox_<[player].uuid>_<[value]> players:<[player]> title:<empty>
|
||||
- define lines <[player].flag[textbox_input]>
|
||||
- foreach <[lines]> as:line:
|
||||
- bossbar update textbox_<[player].uuid>_<[loop_index]> title:<black><bold><[line]>
|
||||
- bossbar update textbox_<[player].uuid>_<[loop_index]> title:<&6><&l><[line]>
|
||||
- flag <[player]> textbox_state:continue
|
||||
|
||||
# Clears textbox and flushes all flag memory values
|
||||
@@ -207,12 +208,12 @@ textbox_handle_click:
|
||||
- ratelimit <player> 5t
|
||||
- else if <[state]> == continue:
|
||||
- determine cancelled passively
|
||||
- playsound sound:textbox.close <player> custom
|
||||
- playsound sound:textbox.close <player> custom volume:<proc[settings_get].context[<player>|sound_textbox_volume].div[100].if_null[1]>
|
||||
- ~run textbox_flush def.player:<player>
|
||||
- ratelimit <player> 10t
|
||||
- else if <[state]> == choice:
|
||||
- determine cancelled passively
|
||||
- playsound sound:input.ok <player> custom
|
||||
- playsound sound:input.ok <player> custom volume:<proc[settings_get].context[<player>|sound_textbox_volume].div[100].if_null[1]>
|
||||
- flag <player> textbox_choice_select:<player.flag[textbox_choices].get[current]>
|
||||
- ~run textbox_flush def.player:<player>
|
||||
- ratelimit <player> 10t
|
||||
@@ -249,7 +250,13 @@ textbox_choice:
|
||||
- teleport <[player]> <[player].location.below.above.with_y[<[player].location.below.above.y.round_down>]>
|
||||
- else:
|
||||
- stop
|
||||
- waituntil <[player].flag[textbox_state].if_null[null]> == null
|
||||
- waituntil <[player].flag[textbox_state].if_null[null]> == null || !<[player].is_online>
|
||||
- if !<[player].is_online>:
|
||||
- if <[queue].if_null[null]> != null:
|
||||
- debug log "[Textbox] Choice; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline"
|
||||
- queue stop <[queue]>
|
||||
- run textbox_flush def.player:<[player]>
|
||||
- stop
|
||||
- ~run textbox_flush def.player:<[player]>
|
||||
- flag <[player]> textbox_state:choice
|
||||
- flag <[player]> textbox_choices:<map[].with[data].as[<[choices]>].with[current].as[left]>
|
||||
@@ -283,35 +290,35 @@ textbox_internal_choice_select:
|
||||
- bossbar create textbox_<[player].uuid>_bottom players:<[player]> title:<empty>
|
||||
- define choices <[player].flag[textbox_choices].get[data]>
|
||||
#
|
||||
- define left <&0><&l><[choices].get[left].get[text].if_null[null]>
|
||||
- define right <&0><&l><[choices].get[right].get[text].if_null[null]>
|
||||
- define top <&0><&l><[choices].get[top].get[text].if_null[null]>
|
||||
- define bottom <&0><&l><[choices].get[bottom].get[text].if_null[null]>
|
||||
- define left <&6><&l><[choices].get[left].get[text].if_null[null]>
|
||||
- define right <&6><&l><[choices].get[right].get[text].if_null[null]>
|
||||
- define top <&6><&l><[choices].get[top].get[text].if_null[null]>
|
||||
- define bottom <&6><&l><[choices].get[bottom].get[text].if_null[null]>
|
||||
#
|
||||
- if <[choice_dir]> == left:
|
||||
- if <[left]> == <&0><&l>null:
|
||||
- if <[left]> == <&6><&l>null:
|
||||
- stop
|
||||
- define left "<&4>❤ <&0><&l><[left]>"
|
||||
- define left "<&4>❤ <&6><&l><[left]>"
|
||||
- else if <[choice_dir]> == right:
|
||||
- if <[right]> == <&0><&l>null:
|
||||
- if <[right]> == <&6><&l>null:
|
||||
- stop
|
||||
- define right "<&4>❤ <&0><&l><[right]>"
|
||||
- define right "<&4>❤ <&6><&l><[right]>"
|
||||
- else if <[choice_dir]> == top:
|
||||
- if <[top]> == <&0><&l>null:
|
||||
- if <[top]> == <&6><&l>null:
|
||||
- stop
|
||||
- define top "<&4>❤ <&0><&l><[top]>"
|
||||
- define top "<&4>❤ <&6><&l><[top]>"
|
||||
- else:
|
||||
- if <[bottom]> == <&0><&l>null:
|
||||
- if <[bottom]> == <&6><&l>null:
|
||||
- stop
|
||||
- define bottom "<&4>❤ <&0><&l><[bottom]>"
|
||||
- define bottom "<&4>❤ <&6><&l><[bottom]>"
|
||||
#
|
||||
- define mid_padding <element[<&sp>].repeat[<element[30].sub[<[left].strip_color.length>].sub[<[right].strip_color.length>]>]>
|
||||
#
|
||||
- if <[top]> != <&0><&l>null:
|
||||
- if <[top]> != <&6><&l>null:
|
||||
- bossbar update textbox_<[player].uuid>_top title:<[top]>
|
||||
- if <[left]> != <&0><&l>null || <[right]> != <&0><&l>null:
|
||||
- if <[left]> != <&6><&l>null || <[right]> != <&6><&l>null:
|
||||
- bossbar update textbox_<[player].uuid>_mid title:<[left]><[mid_padding]><[right]>
|
||||
- if <[bottom]> != <&0><&l>null:
|
||||
- if <[bottom]> != <&6><&l>null:
|
||||
- bossbar update textbox_<[player].uuid>_bottom title:<[bottom]>
|
||||
- flag <[player]> textbox_choices:<map[].with[data].as[<[choices]>].with[current].as[<[choice_dir]>]>
|
||||
- playsound BLOCK_NOTE_BLOCK_BIT <[player]> pitch:2
|
||||
- playsound BLOCK_NOTE_BLOCK_BIT <[player]> pitch:2 volume:<proc[settings_get].context[<[player]>|sound_textbox_volume].div[100].if_null[1]>
|
||||
@@ -16,7 +16,8 @@ liteprofilesutils_world:
|
||||
- flag server liteprofilesutils_lastbestlimit:<[lastbestlimit].with[<[masteruuid]>].as[<[profilelimit].max[<[lastbestlimit].get[<[masteruuid]>].if_null[1]>]>]>
|
||||
#
|
||||
- define joinleavedata <script[liteprofilesutils_data].data_key[join-leave]>
|
||||
- announce <[joinleavedata].get[leave].parsed>
|
||||
- define setting_enabled_players <server.online_players.filter_tag[<proc[settings_get].context[<[filter_value]>|general_see_player_join_leave]>]>
|
||||
- narrate <[joinleavedata].get[leave].parsed> targets:<[setting_enabled_players]>
|
||||
on player joins:
|
||||
- define masteruuid <proc[liteprofilesutils_get_master_uuid].context[<player>]>
|
||||
# sync groups, O(scary)
|
||||
@@ -61,9 +62,14 @@ liteprofilesutils_world:
|
||||
- if <server.flag[liteprofilesutils_welcome].if_null[<list[]>].contains[<player.uuid>]>:
|
||||
- announce <[joinleavedata].get[welcome].parsed>
|
||||
- flag server liteprofilesutils_welcome:<server.flag[liteprofilesutils_welcome].if_null[<list[]>].include[<player.uuid>]>
|
||||
- announce <[joinleavedata].get[join].parsed>
|
||||
- define setting_enabled_players <server.online_players.filter_tag[<proc[settings_get].context[<[filter_value]>|general_see_player_join_leave]>]>
|
||||
- narrate <[joinleavedata].get[join].parsed> targets:<[setting_enabled_players]>
|
||||
## prevent /profile remove
|
||||
on command:
|
||||
- if <context.source_type> != player:
|
||||
- stop
|
||||
- if <player.is_op>:
|
||||
- stop
|
||||
- if <context.command.to_lowercase> == profile || <context.command.to_lowercase> == account || <context.command.to_lowercase> == pf:
|
||||
- if <context.args.get[1].to_lowercase.if_null[null]> == remove:
|
||||
- determine cancelled passively
|
||||
@@ -93,3 +99,11 @@ liteprofilesutils_world:
|
||||
- else if <[data].get[type]> == free:
|
||||
- execute as_player "profile add"
|
||||
- run liteprofilesutils_show_menu def.player:<player>
|
||||
## patch whitelisting
|
||||
on player prelogin:
|
||||
- define uuid <context.uuid>
|
||||
- define master <proc[liteprofilesutils_get_master_uuid].context[<player[<[uuid]>]>]>
|
||||
- if <[master]> == <[uuid]>:
|
||||
- stop
|
||||
- adjust <player[<[uuid]>]> whitelisted:<player[<[master]>].is_whitelisted>
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@ compatibility_check_world:
|
||||
type: world
|
||||
events:
|
||||
after player joins:
|
||||
- define player_version <player.viaversion_version.split[-].get[1].split[.].limit[3].get[1|2].separated_by[.]>
|
||||
- define server_version <server.version.split[(].get[2].split[:].get[2].split[)].get[1].trim.split[.].limit[3].get[1|2].separated_by[.]>
|
||||
- if <proc[settings_get].context[<player>|general_ignore_version_compatibility_check]>:
|
||||
- stop
|
||||
- define player_version <player.viaversion_version.split[-].get[2]>
|
||||
- define server_version <server.version.split[(].get[2].split[:].get[2].split[)].get[1].trim>
|
||||
- if <proc[compatibility_check_compare_versions].context[<[player_version]>|<[server_version]>]> == -1:
|
||||
- wait 5s
|
||||
- if !<player.is_online>:
|
||||
|
||||
5
scripts/misc/various_placeholders.dsc
Normal file
5
scripts/misc/various_placeholders.dsc
Normal file
@@ -0,0 +1,5 @@
|
||||
various_placeholders_staff_rank:
|
||||
debug: false
|
||||
type: procedure
|
||||
script:
|
||||
- determine <placeholder[luckperms_prefix_element_highest_on_track_special].player[<player>].parse_color.to_minimessage>
|
||||
@@ -83,6 +83,7 @@ phones_commands_phonecall:
|
||||
#
|
||||
# before accepted
|
||||
- if !<[target].has_flag[phones_is_maybe_called]>:
|
||||
- if !<proc[settings_get].context[<[target]>|game_disable_phone_ringtone]>:
|
||||
- nbs file:data/phones/songs/<[target].flag[phones].get[ringtone].if_null[Bad Apple]> play targets:<[target]>
|
||||
- narrate targets:<[target]> "<&6>*** <&e>You're being called by <&e><[relative]><&7>."
|
||||
- narrate targets:<[target]> <&hover[<&a>Click to accept call from <[relative]>...]><element[<&a><&l>[ ACCEPT ]].on_click[<entry[accept].command>]><&end_hover>
|
||||
|
||||
12
scripts/settings/settings_commands.dsc
Normal file
12
scripts/settings/settings_commands.dsc
Normal file
@@ -0,0 +1,12 @@
|
||||
settings_command_settings:
|
||||
debug: false
|
||||
type: command
|
||||
name: settings
|
||||
usage: /settings
|
||||
description: Opens the settings menu.
|
||||
permission: settings.command.settings
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- run settings_menu def.player:<player>
|
||||
148
scripts/settings/settings_config.dsc
Normal file
148
scripts/settings/settings_config.dsc
Normal file
@@ -0,0 +1,148 @@
|
||||
settings_config:
|
||||
debug: false
|
||||
type: data
|
||||
tabs:
|
||||
- General
|
||||
- Game
|
||||
- Text
|
||||
- Sounds
|
||||
- Accessibility
|
||||
keys:
|
||||
general_see_player_join_leave:
|
||||
tab: General
|
||||
name: See player join and leave messages
|
||||
description: If enabled, will show in chat when other players join or leave.
|
||||
type: boolean
|
||||
default: true
|
||||
general_ignore_version_compatibility_check:
|
||||
tab: General
|
||||
name: Ignore version compatibility warning
|
||||
description: If enabled, will not show the compatibility warning when joining the server on an old unsupported version.
|
||||
type: boolean
|
||||
default: false
|
||||
##
|
||||
game_see_auto_money_announcements:
|
||||
tab: Game
|
||||
name: See auto money announcements
|
||||
description: If enabled, will show in chat when you receive money for being online.
|
||||
type: boolean
|
||||
default: true
|
||||
game_disable_phone_ringtone:
|
||||
tab: Game
|
||||
name: Disable phone ringtone
|
||||
description: If enabled, the ringtone won't play when your phone is calling.
|
||||
type: boolean
|
||||
default: false
|
||||
##
|
||||
text_rp_chat_color:
|
||||
tab: Text
|
||||
name: Roleplay chat color
|
||||
description: Changes the color used for actions when using in character chat channels. Can also be changed using /chatcolor.
|
||||
type: list
|
||||
default: yellow
|
||||
values:
|
||||
- aqua
|
||||
- blue
|
||||
- fuchsia
|
||||
- gray
|
||||
- green
|
||||
- lime
|
||||
- maroon
|
||||
- navy
|
||||
- olive
|
||||
- orange
|
||||
- purple
|
||||
- red
|
||||
- silver
|
||||
- teal
|
||||
- yellow
|
||||
text_rp_chat_channel:
|
||||
tab: Text
|
||||
name: Current roleplay chat channel
|
||||
description: The channel you are currently using. Can also be changed using /chsw.
|
||||
type: list
|
||||
default: ic
|
||||
values:
|
||||
- ic
|
||||
- ooc
|
||||
text_rp_chat_distance_warning:
|
||||
tab: Text
|
||||
name: Warn when no message receivers
|
||||
description: If enabled, will warn you when your in character chat channel message was not seen by any other player.
|
||||
type: boolean
|
||||
default: true
|
||||
text_textbox_write_speed:
|
||||
tab: Text
|
||||
name: Textbox write speed
|
||||
description: How fast textboxes should write text.
|
||||
type: number
|
||||
default: 2
|
||||
min: 1
|
||||
max: 3
|
||||
increment: 1
|
||||
##
|
||||
sound_textbox_volume:
|
||||
tab: Sounds
|
||||
name: Textbox volume
|
||||
description: Changes the volume when the textbox is writing.
|
||||
type: number
|
||||
default: 50
|
||||
min: 0
|
||||
max: 100
|
||||
increment: 5
|
||||
sound_vehicles_volume:
|
||||
tab: Sounds
|
||||
name: Vehicles volume
|
||||
description: Changes the volume of vehicle engines.
|
||||
type: number
|
||||
default: 50
|
||||
min: 0
|
||||
max: 100
|
||||
increment: 5
|
||||
##
|
||||
accessibility_chat_disable_colors:
|
||||
tab: Accessibility
|
||||
name: Disable colors in chat
|
||||
description: If enabled, hides all colors in chat, instead using plain white.
|
||||
type: boolean
|
||||
default: false
|
||||
accessibility_rp_chat_space_messages:
|
||||
tab: Accessibility
|
||||
name: Space messages for in character chat channels
|
||||
description: If enabled, in character chat channel messages will be begin and end with a new line to distinguish where the message begins and ends.
|
||||
type: boolean
|
||||
default: false
|
||||
##
|
||||
# example1_key:
|
||||
# tab: General
|
||||
# name: example1 setting key
|
||||
# description: example1 description
|
||||
# type: boolean
|
||||
# default: true
|
||||
# example2_key:
|
||||
# tab: General
|
||||
# name: example2 setting key
|
||||
# description: example2 description
|
||||
# type: number
|
||||
# default: 5
|
||||
# min: 0
|
||||
# max: 10
|
||||
# increment: 0.5
|
||||
# example3_key:
|
||||
# tab: Miscellaneous
|
||||
# name: example3 setting key
|
||||
# description: example3 description
|
||||
# type: list
|
||||
# default: male
|
||||
# values:
|
||||
# - male
|
||||
# - female
|
||||
# - prefer not to say
|
||||
# example4_key:
|
||||
# tab: Miscellaneous
|
||||
# name: example4 setting key
|
||||
# description: example4 description
|
||||
# type: text
|
||||
# default: text
|
||||
# max-length: 64
|
||||
# regex: "[a-z]+"
|
||||
308
scripts/settings/settings_tasks.dsc
Normal file
308
scripts/settings/settings_tasks.dsc
Normal file
@@ -0,0 +1,308 @@
|
||||
settings_set:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|key|value
|
||||
script:
|
||||
- define keys <script[settings_config].data_key[keys]>
|
||||
- if !<[keys].contains[<[key]>]>:
|
||||
- determine "Key not found: <[key]>"
|
||||
- if <[value]> == null:
|
||||
- determine "Value cannot be null"
|
||||
- define data <[keys].get[<[key]>]>
|
||||
- define type <[data].get[type]>
|
||||
- choose <[type].to_lowercase>:
|
||||
- case boolean:
|
||||
- if <[value]> != true && <[value]> != false:
|
||||
- determine "Value must be true or false"
|
||||
- case number:
|
||||
- define min <[data].get[min]>
|
||||
- define max <[data].get[max]>
|
||||
- if <[value]> < <[min]> || <[value]> > <[max]>:
|
||||
- determine "Value must be between <[min]> and <[max]>"
|
||||
- case list:
|
||||
- define values <[data].get[values]>
|
||||
- if !<[values].contains[<[value]>]>:
|
||||
- determine "Value must be one of the following: <[values].formatted>"
|
||||
- case text:
|
||||
- define max_length <[data].get[max-length]>
|
||||
- define regex <[data].get[regex]>
|
||||
- if <[value].length> > <[max_length]>:
|
||||
- determine "Value must be shorter than <[max_length]> characters"
|
||||
- if !<[value].regex_matches[<[regex]>]>:
|
||||
- determine "Value should match the regex <[regex]>"
|
||||
- default:
|
||||
- determine "Unknown type <[type]>"
|
||||
- define settings <[player].flag[settings].if_null[<map[]>]>
|
||||
- define settings <[settings].with[<[key]>].as[<[value]>]>
|
||||
- flag <[player]> settings:<[settings]>
|
||||
|
||||
settings_get:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: player|key
|
||||
script:
|
||||
- define keys <script[settings_config].data_key[keys]>
|
||||
- if !<[keys].contains[<[key]>]>:
|
||||
- determine null
|
||||
- define settings <[player].flag[settings].if_null[<map[]>]>
|
||||
- define value <[settings].get[<[key]>].if_null[<[keys].get[<[key]>].get[default]>]>
|
||||
- determine <[value]>
|
||||
|
||||
settings_all_settings_from_tab:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: tab
|
||||
script:
|
||||
- define keys <script[settings_config].data_key[keys]>
|
||||
- define keys_in_tab <[keys].keys.filter_tag[<[keys].get[<[filter_value]>].get[tab].equals[<[tab]>]>]>
|
||||
- determine <[keys_in_tab]>
|
||||
|
||||
settings_all_settings_from_page_from_tab:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: tab|page
|
||||
script:
|
||||
- define keys_in_tab <proc[settings_all_settings_from_tab].context[<[tab]>]>
|
||||
- define start_index <[page].mul[4].add[1]>
|
||||
- define end_index <[page].add[1].mul[4]>
|
||||
- determine <[keys_in_tab].get[<[start_index]>].to[<[end_index]>]>
|
||||
|
||||
settings_menu_is_last_page:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: tab|page
|
||||
script:
|
||||
- define keys_in_tab <proc[settings_all_settings_from_tab].context[<[tab]>]>
|
||||
- define end_index <[page].add[1].mul[4]>
|
||||
- determine <[end_index].is_more_than_or_equal_to[<[keys_in_tab].size>]>
|
||||
|
||||
settings_menu_set_non_text:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|key|value|tab|page
|
||||
script:
|
||||
- run settings_set def.player:<[player]> def.key:<[key]> def.value:<[value]> save:result
|
||||
- define error <entry[result].created_queue.determination.get[1].if_null[null]>
|
||||
- if <[error]> == null:
|
||||
- run settings_menu def.player:<[player]> def.tab:<[tab]> def.page:<[page]>
|
||||
- else:
|
||||
- narrate targets:<[player]> <&c><[error]>
|
||||
|
||||
settings_menu_set_text_callback:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|input
|
||||
script:
|
||||
- define temp_state <[player].flag[settings_menu_temp_state]>
|
||||
- run settings_set def.player:<[player]> def.key:<[temp_state].get[key]> def.value:<[input]> save:result
|
||||
- define error <entry[result].created_queue.determination.get[1].if_null[null]>
|
||||
- if <[error]> != null:
|
||||
- narrate targets:<[player]> <&c><[error]>
|
||||
- wait 4t
|
||||
- run settings_menu def.player:<[player]> def.tab:<[temp_state].get[tab]> def.page:<[temp_state].get[page]>
|
||||
|
||||
settings_menu_set_text_helper:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|key|tab|page
|
||||
script:
|
||||
- definemap temp_state:
|
||||
key: <[key]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- flag <[player]> settings_menu_temp_state:<[temp_state]>
|
||||
- run anvil_input def.player:<[player]> "def.prompt:New value" def.callback:settings_menu_set_text_callback
|
||||
|
||||
settings_menu:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|tab|page
|
||||
script:
|
||||
- define keys <script[settings_config].data_key[keys]>
|
||||
- define tabs <script[settings_config].data_key[tabs]>
|
||||
- define tab <[tab].if_null[<[tabs].get[1]>]>
|
||||
- define page <[page].if_null[0]>
|
||||
- define contents <map[]>
|
||||
- if <[page]> > 0:
|
||||
- inject settings_menu_previous_page
|
||||
- if !<proc[settings_menu_is_last_page].context[<[tab]>|<[page]>]>:
|
||||
- inject settings_menu_next_page
|
||||
- inject settings_menu_render_tabs
|
||||
- inject settings_menu_render_settings
|
||||
- run menu_open def.player:<[player]> def.title:<&f>邑邑邑邑酕<&a><&sp><&b><&sp><&c><&sp> def.size:54 def.contents:<[contents]>
|
||||
|
||||
settings_menu_previous_page:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define previous_button <item[ender_pearl[display=<&2><<><<>]]>
|
||||
- definemap content_entry:
|
||||
49:
|
||||
item: <[previous_button]>
|
||||
script: settings_menu
|
||||
definitions:
|
||||
player: <[player]>
|
||||
tab: <[tab]>
|
||||
page: <[page].sub[1]>
|
||||
- define contents <[contents].include[<[content_entry]>]>
|
||||
|
||||
settings_menu_next_page:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define next_button <item[ender_eye[display=<&2><>><>>]]>
|
||||
- definemap content_entry:
|
||||
51:
|
||||
item: <[next_button]>
|
||||
script: settings_menu
|
||||
definitions:
|
||||
player: <[player]>
|
||||
tab: <[tab]>
|
||||
page: <[page].add[1]>
|
||||
- define contents <[contents].include[<[content_entry]>]>
|
||||
|
||||
settings_menu_render_tabs:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- foreach <[tabs]> as:t:
|
||||
- define tab_button <item[<tern[<[t].equals[<[tab]>]>].pass[enchanted_book].fail[book]>[display=<&b><[t]>]]>
|
||||
- definemap content_entry_value:
|
||||
item: <[tab_button]>
|
||||
script: settings_menu
|
||||
definitions:
|
||||
player: <[player]>
|
||||
tab: <[t]>
|
||||
page: 0
|
||||
- define content_entry <map[].with[<[loop_index]>].as[<[content_entry_value]>]>
|
||||
- define contents <[contents].include[<[content_entry]>]>
|
||||
|
||||
settings_menu_render_settings:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- foreach <proc[settings_all_settings_from_page_from_tab].context[<[tab]>|<[page]>]> as:setting_key:
|
||||
- define setting_item <item[paper[display=<&3><[keys].get[<[setting_key]>].get[name]>;lore=<[keys].get[<[setting_key]>].get[description].split_lines_by_width[<[keys].get[<[setting_key]>].get[name].text_width>].split[<&nl>].parse_tag[<&7><[parse_value]>]>]]>
|
||||
- definemap content_entry_value:
|
||||
item: <[setting_item]>
|
||||
- define position <[loop_index].mul[9].add[1]>
|
||||
- define content_entry <map[].with[<[position]>].as[<[content_entry_value]>]>
|
||||
- define data <[keys].get[<[setting_key]>]>
|
||||
- define type <[data].get[type]>
|
||||
- choose <[type].to_lowercase>:
|
||||
- case boolean:
|
||||
- inject settings_menu_render_settings_boolean
|
||||
- case number:
|
||||
- inject settings_menu_render_settings_number
|
||||
- case list:
|
||||
- inject settings_menu_render_settings_list
|
||||
- case text:
|
||||
- inject settings_menu_render_settings_text
|
||||
- default:
|
||||
- debug error "Unknown setting type for <[setting_key]>"
|
||||
- stop
|
||||
- define contents <[contents].include[<[content_entry]>]>
|
||||
|
||||
settings_menu_render_settings_boolean:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define value <proc[settings_get].context[<[player]>|<[setting_key]>]>
|
||||
- define boolean_value_button <tern[<[value]>].pass[<item[emerald[display=<&2>On]]>].fail[<item[redstone[display=<&c>Off]]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[boolean_value_button]>
|
||||
script: settings_menu_set_non_text
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
value: <[value].not>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[8]>].as[<[content_entry_value]>]>
|
||||
|
||||
settings_menu_render_settings_number:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define value <proc[settings_get].context[<[player]>|<[setting_key]>]>
|
||||
- define increment <[data].get[increment]>
|
||||
- define decrement_button <item[medium_amethyst_bud[display=<&9>-<[increment]>]]>
|
||||
- define increment_button <item[amethyst_cluster[display=<&9>+<[increment]>]]>
|
||||
- define value_item <item[name_tag[display=<&9><[value]>]]>
|
||||
- definemap content_entry_value:
|
||||
item: <[decrement_button]>
|
||||
script: settings_menu_set_non_text
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
value: <[value].sub[<[increment]>]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[6]>].as[<[content_entry_value]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[increment_button]>
|
||||
script: settings_menu_set_non_text
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
value: <[value].add[<[increment]>]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[8]>].as[<[content_entry_value]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[value_item]>
|
||||
- define content_entry <[content_entry].with[<[position].add[7]>].as[<[content_entry_value]>]>
|
||||
|
||||
settings_menu_render_settings_list:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define value <proc[settings_get].context[<[player]>|<[setting_key]>]>
|
||||
- define values <[data].get[values]>
|
||||
- define index <[values].find[<[value]>]>
|
||||
- define previous_button <item[medium_amethyst_bud[display=<&9>Previous]]>
|
||||
- define next_button <item[amethyst_cluster[display=<&9>Next]]>
|
||||
- define value_item <item[name_tag[display=<&9><[value]>]]>
|
||||
- definemap content_entry_value:
|
||||
item: <[previous_button]>
|
||||
script: settings_menu_set_non_text
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
value: <tern[<[index].equals[1]>].pass[<[values].get[-1]>].fail[<[values].get[<[index].sub[1]>]>]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[6]>].as[<[content_entry_value]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[next_button]>
|
||||
script: settings_menu_set_non_text
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
value: <tern[<[index].equals[<[values].size>]>].pass[<[values].get[1]>].fail[<[values].get[<[index].add[1]>]>]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[8]>].as[<[content_entry_value]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[value_item]>
|
||||
- define content_entry <[content_entry].with[<[position].add[7]>].as[<[content_entry_value]>]>
|
||||
|
||||
settings_menu_render_settings_text:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- define value <proc[settings_get].context[<[player]>|<[setting_key]>]>
|
||||
- define value_item <item[name_tag[display=<&9><[value]>]]>
|
||||
- define change_button <item[writable_book[display=<&9>Change]]>
|
||||
- definemap content_entry_value:
|
||||
item: <[change_button]>
|
||||
script: settings_menu_set_text_helper
|
||||
definitions:
|
||||
player: <[player]>
|
||||
key: <[setting_key]>
|
||||
tab: <[tab]>
|
||||
page: <[page]>
|
||||
- define content_entry <[content_entry].with[<[position].add[8]>].as[<[content_entry_value]>]>
|
||||
- definemap content_entry_value:
|
||||
item: <[value_item]>
|
||||
- define content_entry <[content_entry].with[<[position].add[7]>].as[<[content_entry_value]>]>
|
||||
@@ -7,7 +7,10 @@ sports_football_world:
|
||||
- ratelimit <player> 10t
|
||||
- if !<context.entity.has_flag[ball]>:
|
||||
- stop
|
||||
- if !<context.entity.flag[ball].starts_with[sports_football]>:
|
||||
- define ball <context.entity>
|
||||
- if <[ball].type> != slime:
|
||||
- define ball <proc[ball_get].context[<[ball].flag[ball]>]>
|
||||
- if !<[ball].flag[ball].starts_with[sports_football]>:
|
||||
- stop
|
||||
- if !<player.has_flag[sports]>:
|
||||
- stop
|
||||
@@ -19,13 +22,13 @@ sports_football_world:
|
||||
- define min_y <player.eye_location.direction.vector.y>
|
||||
- if <[min_y]> < 0:
|
||||
- define min_y 0
|
||||
- define velo <context.entity.flag[ball_velocity].normalize.mul[0.05]>
|
||||
- define velo <[ball].flag[ball_velocity].normalize.mul[0.05]>
|
||||
- define kick <player.eye_location.direction.vector.mul[0.75].with_y[<[min_y]>].add[0,0.25,0].add[<[velo]>]>
|
||||
- if <player.is_sprinting>:
|
||||
- define kick <player.eye_location.direction.vector.with_y[0.25].mul[1.5]>
|
||||
- if !<player.is_on_ground>:
|
||||
- define kick <player.eye_location.direction.vector.with_y[0.75].mul[1.5]>
|
||||
- run ball_vector_add def.ball:<context.entity> def.vector:<[kick]>
|
||||
- run ball_vector_add def.ball:<[ball]> def.vector:<[kick]>
|
||||
## out of bounds & ball collision
|
||||
on player walks:
|
||||
- if !<player.has_flag[sports]>:
|
||||
|
||||
@@ -8,7 +8,7 @@ sports_volleyball_world:
|
||||
- define ball <context.entity>
|
||||
- if !<[ball].has_flag[ball]>:
|
||||
- stop
|
||||
- if <[ball].type> == armor_stand:
|
||||
- if <[ball].type> != slime:
|
||||
- define ball <proc[ball_get].context[<[ball].flag[ball]>]>
|
||||
- if !<[ball].flag[ball].starts_with[sports_volleyball]>:
|
||||
- stop
|
||||
|
||||
@@ -2,8 +2,10 @@ ch1_1_preassign:
|
||||
debug: false
|
||||
type: world
|
||||
events:
|
||||
on player joins:
|
||||
after player joins:
|
||||
- wait 1s
|
||||
- if <proc[storyboard_player_state_get].context[<player>|preassign]> == null:
|
||||
- if !<proc[storyboard_npc_exists].context[<player>|marie]>:
|
||||
- run storyboard_npc_memalloc "def:<player>|marie|player|<location[-4,2,-15,world]>|Marie Ayashibayomi|true|<script[storyboard_skin_dump].data_key[marie].get[a]>"
|
||||
- run storyboard_npc_set_assignment def.player:<player> def.name:marie def.assignment:ch1_1_marie_assign
|
||||
- run storyboard_player_state_set def.player:<player> def.key:preassign def.value:true
|
||||
@@ -34,6 +36,7 @@ ch1_1_marie_interact:
|
||||
1:
|
||||
click trigger:
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- if <player.flag[textbox_state].if_null[null]> != null:
|
||||
- stop
|
||||
- engage player duration:999999s
|
||||
@@ -97,9 +100,11 @@ ch1_1_marie_interact:
|
||||
- run storyboard_npc_state_set def.player:<player> def.name:marie def.key:opinion def.value:-1
|
||||
- zap 2
|
||||
- disengage player
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
2:
|
||||
click trigger:
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- if <player.flag[textbox_state].if_null[null]> != null:
|
||||
- stop
|
||||
- engage player duration:999999s
|
||||
@@ -128,6 +133,7 @@ ch1_1_marie_interact:
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:* Mkay." def.avatar_unicode:<script[storyboard_avatar_dump].data_key[marie].get[upset]>
|
||||
- wait 1s
|
||||
- disengage player
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- stop
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:* Hm. Are you now?" def.avatar_unicode:<script[storyboard_avatar_dump].data_key[marie].get[upset]>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:* You know, that was kind of$$nlmean of you." def.avatar_unicode:<script[storyboard_avatar_dump].data_key[marie].get[upset]>
|
||||
@@ -235,3 +241,4 @@ ch1_1_marie_interact:
|
||||
- inventory update
|
||||
- zap 3
|
||||
- disengage player
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
@@ -14,6 +14,7 @@ dialogue_npc_kobayashi:
|
||||
1:
|
||||
click trigger:
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- if <player.flag[textbox_state].if_null[null]> != null:
|
||||
- stop
|
||||
- engage player
|
||||
@@ -45,3 +46,4 @@ dialogue_npc_kobayashi:
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:Indeed, luv."
|
||||
- wait 1s
|
||||
- disengage player
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
@@ -14,6 +14,7 @@ dialogue_npc_patchouli:
|
||||
1:
|
||||
click trigger:
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- if <player.flag[textbox_state].if_null[null]> != null:
|
||||
- stop
|
||||
- engage player
|
||||
@@ -23,3 +24,4 @@ dialogue_npc_patchouli:
|
||||
- wait 1s
|
||||
- disengage player
|
||||
- ratelimit <player> 10t
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
@@ -14,6 +14,7 @@ dialogue_npc_ryuko:
|
||||
1:
|
||||
click trigger:
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- if <player.flag[textbox_state].if_null[null]> != null:
|
||||
- stop
|
||||
- engage player
|
||||
@@ -29,3 +30,4 @@ dialogue_npc_ryuko:
|
||||
- wait 1s
|
||||
- disengage player
|
||||
- ratelimit <player> 10t
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
@@ -15,11 +15,13 @@ intro_interact_posters_task:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:Book-related posters are on the wall."
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:<&o><&dq>Screw that. I'm running away.<&dq>"
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> def.line3s:<&o><&dq>Where?<&dq>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:<&o><&dq>Dunno. Do you want to come?<&dq>"
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:<&o><&dq>Yes,<&dq> I said without thinking."
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
# Cirno
|
||||
intro_interact_cirno:
|
||||
@@ -38,8 +40,10 @@ intro_interact_cirno_task:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:A quality, soft plushie of a beloved$$nlcharacter."
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:It seems familiar, as if there are a$$nlsubstantial amount of images circulating$$nlaround with this character."
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
# Laptop
|
||||
intro_interact_laptop:
|
||||
@@ -58,12 +62,14 @@ intro_interact_laptop_task:
|
||||
debug: false
|
||||
type: task
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:It looks like a game is booted up.$$nlYou can see a city, and it looks like..."
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:. . ."
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:It's <bold>you!$$nl. . .$$nlWell, it's your character."
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:You should give your character$$nla cool name, right?"
|
||||
- waituntil <player.has_flag[textbox_state].not> max:5s
|
||||
- ~run textbox_flush def.player:<player>
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- run anvil_input def.player:<player> "def.prompt:Character Name" def.callback:intro_interact_laptop_task_name_callback
|
||||
|
||||
intro_interact_laptop_task_name_callback:
|
||||
@@ -71,14 +77,21 @@ intro_interact_laptop_task_name_callback:
|
||||
type: task
|
||||
definitions: player|input
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- define __player <[player]>
|
||||
- define name <[input].substring[1,24]>
|
||||
- if <server.flag[character_rpnames].contains[<[name]>]>:
|
||||
- narrate targets:<[player]> "<&c>That RP name is already taken. Try a different one!"
|
||||
- wait 1s
|
||||
- run anvil_input def.player:<player> "def.prompt:Character Name" def.callback:intro_interact_laptop_task_name_callback
|
||||
- stop
|
||||
- execute as_player player:<[player]> "rpname <[name]>"
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> def.line3s:<[name]>
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:How nice!"
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:Let's give them a description.$$nlDescribe their physical attributes."
|
||||
- waituntil <player.has_flag[textbox_state].not> max:5s
|
||||
- ~run textbox_flush def.player:<player>
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- run anvil_input def.player:<player> def.prompt:Description def.callback:intro_interact_laptop_task_description_callback
|
||||
|
||||
intro_interact_laptop_task_description_callback:
|
||||
@@ -86,6 +99,7 @@ intro_interact_laptop_task_description_callback:
|
||||
type: task
|
||||
definitions: player|input
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- define __player <[player]>
|
||||
- execute as_player player:<[player]> "setdesc <[input]>"
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:Great, your character's almost ready."
|
||||
@@ -94,6 +108,7 @@ intro_interact_laptop_task_description_callback:
|
||||
- ~run textbox_write def.player:<player> def.queue:<queue> "def.line3s:For complete beginners, we recommend$$nlstarting out as a student."
|
||||
- waituntil <player.has_flag[textbox_state].not> max:5s
|
||||
- ~run textbox_flush def.player:<player>
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- run intro_interact_laptop_task_role_menu def.player:<player>
|
||||
|
||||
intro_interact_laptop_task_role_menu:
|
||||
@@ -123,6 +138,7 @@ intro_interact_laptop_task_role_callback:
|
||||
type: task
|
||||
definitions: player|input
|
||||
script:
|
||||
- run storyboard_player_begin_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
- inventory close player:<[player]>
|
||||
- define __player <[player]>
|
||||
- define adult <[input].to_lowercase.trim.equals[yes]>
|
||||
@@ -197,3 +213,4 @@ intro_interact_laptop_task_role_callback:
|
||||
- adjust <player> show_to_players
|
||||
- flag <player> intro:done
|
||||
- execute as_player player:<player> spawn
|
||||
- run storyboard_player_end_atomic_sequence def.queue:<queue> def.player:<player>
|
||||
|
||||
@@ -39,8 +39,10 @@ storyboard_npc_memalloc:
|
||||
- define npc_id npc_<[player].uuid>_<[name]>
|
||||
- if !<server.npcs[<[registry]>].if_null[<list[]>].contains[<[npc_id]>]>:
|
||||
- define npcs <[player].flag[storyboard_state].get[npcs].if_null[<map[]>]>
|
||||
- chunkload <[at].chunk> duration:10s
|
||||
- create <[type]> <[npc_id]> <[at]> registry:<[registry]> save:npc
|
||||
- define npc <entry[npc].created_npc>
|
||||
- playeffect at:<[npc].location.above[1]> offset:0.35,1,0.35 effect:SOUL_FIRE_FLAME quantity:20
|
||||
- define npc_state <map[]>
|
||||
- define assignment null
|
||||
- if <[npcs].contains[<[name]>]>:
|
||||
@@ -83,7 +85,7 @@ storyboard_npc_memalloc:
|
||||
- adjust <[npc]> skin_blob:<[skin_blob]>
|
||||
- if <[assignment]> != null:
|
||||
- assignment set script:<[assignment]> to:<[npc]>
|
||||
- wait 2t
|
||||
- wait 1t
|
||||
- run storyboard_npc_internal_show_to_player def.player:<[player]> def.npc:<[npc]>
|
||||
- else:
|
||||
- define index <server.npcs[<[registry]>].find[<[npc_id]>]>
|
||||
@@ -98,7 +100,7 @@ storyboard_npc_by_name:
|
||||
script:
|
||||
- define registry registry_<[player].uuid>
|
||||
- define npc_id npc_<[player].uuid>_<[name]>
|
||||
- determine <server.npcs[<[registry]>].filter_tag[<[filter_value].name.equals[<[npc_id]>]>].get[1]>
|
||||
- determine <server.npcs[<[registry]>].filter_tag[<[filter_value].name.equals[<[npc_id]>]>].get[1].if_null[null]>
|
||||
|
||||
# Frees an NPC from memory, but does not destroy its state.
|
||||
#
|
||||
@@ -137,6 +139,14 @@ storyboard_npc_memdestroy:
|
||||
- define npc <proc[storyboard_npc_by_name].context[<[player]>|<[name]>]>
|
||||
- remove <[npc]>
|
||||
|
||||
# Checks if an NPC exists for the given player.
|
||||
storyboard_npc_exists:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: player|name
|
||||
script:
|
||||
- determine <proc[storyboard_npc_by_name].context[<[player]>|<[name]>].if_null[null].equals[null].not>
|
||||
|
||||
# Flags the NPC by name, mapping the given key to the given value.
|
||||
storyboard_npc_state_set:
|
||||
debug: false
|
||||
@@ -215,9 +225,11 @@ storyboard_npc_internal_auto_memory_management:
|
||||
type: world
|
||||
events:
|
||||
after player joins:
|
||||
- wait 1s
|
||||
- define npcs <player.flag[storyboard_state].get[npcs].if_null[<map[]>]>
|
||||
- foreach <[npcs]> key:name as:data:
|
||||
- if <[data].get[allocated].if_null[null]> == reallocate:
|
||||
- define allocated <[data].get[allocated].if_null[null]>
|
||||
- if <[allocated]> == reallocate || <[allocated]>:
|
||||
- define name <[data].get[name]>
|
||||
- define type <[data].get[type]>
|
||||
- define at <[data].get[at]>
|
||||
@@ -246,6 +258,7 @@ storyboard_npc_internal_auto_display_entities:
|
||||
type: world
|
||||
events:
|
||||
after player joins bukkit_priority:high:
|
||||
- wait 1t
|
||||
- foreach <server.online_players.exclude[<player>]> as:target:
|
||||
- define registry registry_<[target].uuid>
|
||||
- define npcs <server.npcs[<[registry]>].if_null[<list[]>]>
|
||||
|
||||
@@ -60,6 +60,37 @@ storyboard_player_unfreeze:
|
||||
- adjust <player> walk_speed:<player.flag[storyboard_freeze_speed]>
|
||||
- flag <player> storyboard_freeze_speed:!
|
||||
|
||||
# Marks the script after this task as an atomic sequence, meaning that
|
||||
# the script either fully completes or is restored back to this point.
|
||||
# This task does not ensure the atomicity, instead it will block any
|
||||
# futher executions of the given script (deduced from the queue) until
|
||||
# storyboard_player_end_atomic_sequence is called, or until the player
|
||||
# logs off (which basically negates the atomicity). The developer must
|
||||
# ensure that the script enclosed by the begin and end tasks is atomic.
|
||||
storyboard_player_begin_atomic_sequence:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: queue|player
|
||||
script:
|
||||
- if <[player].flag[storyboard_atomic].if_null[<map[]>].contains[<[queue].script.name>]>:
|
||||
- queue <[queue]> stop
|
||||
- stop
|
||||
- flag <[player]> storyboard_atomic:<[player].flag[storyboard_atomic].if_null[<map[]>].with[<[queue].script.name>].as[<util.time_now>]>
|
||||
|
||||
# Ends the atomic sequence above this task. See the sibling task
|
||||
# storyboard_player_begin_atomic_sequence for more details.
|
||||
storyboard_player_end_atomic_sequence:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: queue|player
|
||||
script:
|
||||
- if !<[player].flag[storyboard_atomic].if_null[<map[]>].contains[<[queue].script.name>]>:
|
||||
- debug error "Tried ending storyboard atomic sequence <[queue].script.name> before storyboard_player_begin_atomic_sequence was called! (Player UUID <[player].uuid>)"
|
||||
- stop
|
||||
- waituntil !<player.has_flag[textbox_state]>
|
||||
- wait 5t
|
||||
- flag <[player]> storyboard_atomic:<[player].flag[storyboard_atomic].if_null[<map[]>].exclude[<[queue].script.name>]>
|
||||
|
||||
## Internal only!
|
||||
storyboard_player_freeze_check:
|
||||
debug: false
|
||||
@@ -68,3 +99,12 @@ storyboard_player_freeze_check:
|
||||
on player joins:
|
||||
- if <player.has_flag[storyboard_freeze_speed]>:
|
||||
- run storyboard_player_unfreeze def.player:<player>
|
||||
|
||||
storyboard_player_atomic_sequence_disconnect_handler:
|
||||
debug: false
|
||||
type: world
|
||||
events:
|
||||
on player quit:
|
||||
- flag <player> storyboard_atomic:!
|
||||
on player joins:
|
||||
- flag <player> storyboard_atomic:!
|
||||
|
||||
@@ -4,7 +4,10 @@ tabcomplete_config:
|
||||
groups:
|
||||
default:
|
||||
commands:
|
||||
# please keep these here...
|
||||
- plugins
|
||||
- denizenclickable
|
||||
# anything else
|
||||
- sit
|
||||
- lay
|
||||
- crawl
|
||||
@@ -76,3 +79,4 @@ tabcomplete_config:
|
||||
- chatcolor
|
||||
- spawn
|
||||
- profiles
|
||||
- settings
|
||||
|
||||
@@ -156,7 +156,8 @@ vehicle_world_parallel_loop:
|
||||
- teleport <[vehicle]> <[new_location]> cause:plugin offthread_repeat:8
|
||||
- flag <[vehicle]> vehicles_speed:<[speed]>
|
||||
- if <[vehicle].flag[vehicles_data].get[driver_entity].has_passenger>:
|
||||
- playsound <[new_location]> custom sound:vehicle.engine pitch:<element[0.5].add[<[speed].abs.mul[32].mod[24].round_down.div[18]>]>
|
||||
- foreach <[vehicle].location.find_players_within[15]> as:listener:
|
||||
- playsound <[new_location]> <[listener]> custom sound:vehicle.engine pitch:<element[0.5].add[<[speed].abs.mul[32].mod[24].round_down.div[18]>]> volume:<proc[settings_get].context[<[listener]>|sound_vehicles_volume].div[200]>
|
||||
- if <[vehicle].flag[vehicles_last_location]> == <[new_location]>:
|
||||
- stop
|
||||
- define driver_entity <[vehicle].flag[vehicles_data].get[driver_entity]>
|
||||
|
||||
Reference in New Issue
Block a user