Skip to content

Commit

Permalink
Check for sunrise (time < 30) for rejuvenation instead of tracking night
Browse files Browse the repository at this point in the history
Players can sleep away thunderstorms, which can occur during the day. Switching to checking for sunrise at time < 30 will cover this case.
  • Loading branch information
tryal-leaf committed May 18, 2021
1 parent 4c51feb commit 5b96eca
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 148 deletions.
112 changes: 38 additions & 74 deletions datapack/data/phoenix/powers/rejuvenation.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,44 @@
{
"type": "origins:multiple",
"is_night": {
"type": "origins:resource",
"min": 0,
"max": 1,
"hud_render": {
"should_render": false
}
},
"update": {
"type": "origins:action_over_time",
"interval": 20,
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:if_else",
"condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "12544"
},
{
"type": "origins:resource",
"resource": "phoenix:rejuvenation_is_night",
"comparison": ">=",
"compare_to": 1
},
{
"type": "origins:resource",
"resource": "phoenix:rebirth_state",
"comparison": ">=",
"compare_to": 1
}
]
},
"if_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:execute_command",
"command": "function phoenix:rebirth_full_size",
"permission_level": 4
},
{
"type": "origins:heal",
"amount": 6
}
]
}
"type": "origins:action_over_time",
"interval": 20,
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:if_else",
"condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "30"
},
{
"type": "origins:resource",
"resource": "phoenix:rebirth_state",
"comparison": ">=",
"compare_to": 1
}
]
},
{
"type": "origins:if_else",
"condition": {
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "12544"
},
"if_action": {
"type": "origins:change_resource",
"resource": "phoenix:rejuvenation_is_night",
"change": -1
},
"else_action": {
"type": "origins:change_resource",
"resource": "phoenix:rejuvenation_is_night",
"change": 1
}
"if_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:execute_command",
"command": "function phoenix:rebirth_full_size",
"permission_level": 4
},
{
"type": "origins:heal",
"amount": 6
}
]
}
]
}
}
]
},
"name": "Rejuvenation",
"description": "At sunrise, if you were in your Reborn Form, you will return to Normal Form."
Expand Down
112 changes: 38 additions & 74 deletions src/main/resources/data/phoenix/powers/rejuvenation.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,44 @@
{
"type": "origins:multiple",
"is_night": {
"type": "origins:resource",
"min": 0,
"max": 1,
"hud_render": {
"should_render": false
}
},
"update": {
"type": "origins:action_over_time",
"interval": 20,
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:if_else",
"condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "12544"
},
{
"type": "origins:resource",
"resource": "phoenix:rejuvenation_is_night",
"comparison": ">=",
"compare_to": 1
},
{
"type": "origins:resource",
"resource": "phoenix:rebirth_state",
"comparison": ">=",
"compare_to": 1
}
]
},
"if_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:execute_command",
"command": "function phoenix:rebirth_full_size",
"permission_level": 4
},
{
"type": "origins:heal",
"amount": 6
}
]
}
"type": "origins:action_over_time",
"interval": 20,
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:if_else",
"condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "30"
},
{
"type": "origins:resource",
"resource": "phoenix:rebirth_state",
"comparison": ">=",
"compare_to": 1
}
]
},
{
"type": "origins:if_else",
"condition": {
"type": "origins:command",
"command": "time query daytime",
"comparison": "<",
"compare_to": "12544"
},
"if_action": {
"type": "origins:change_resource",
"resource": "phoenix:rejuvenation_is_night",
"change": -1
},
"else_action": {
"type": "origins:change_resource",
"resource": "phoenix:rejuvenation_is_night",
"change": 1
}
"if_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:execute_command",
"command": "function phoenix:rebirth_full_size",
"permission_level": 4
},
{
"type": "origins:heal",
"amount": 6
}
]
}
]
}
}
]
},
"name": "Rejuvenation",
"description": "At sunrise, if you were in your Reborn Form, you will return to Normal Form."
Expand Down

0 comments on commit 5b96eca

Please sign in to comment.