-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e42e3f
commit c9d4a2b
Showing
5 changed files
with
276 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...in/java/generations/gg/generations/core/generationscore/common/world/item/RotomCatalog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package generations.gg.generations.core.generationscore.common.world.item | ||
|
||
import com.cobblemon.mod.common.api.dialogue.Dialogue | ||
import com.cobblemon.mod.common.api.dialogue.Dialogues | ||
import com.cobblemon.mod.common.util.openDialogue | ||
import generations.gg.generations.core.generationscore.common.GenerationsCore | ||
import net.minecraft.network.chat.Component | ||
import net.minecraft.server.level.ServerPlayer | ||
import net.minecraft.world.InteractionHand | ||
import net.minecraft.world.InteractionResultHolder | ||
import net.minecraft.world.entity.player.Player | ||
import net.minecraft.world.item.Item | ||
import net.minecraft.world.item.ItemStack | ||
import net.minecraft.world.level.Level | ||
|
||
class RotomCatalog(properties: Properties) : Item(properties) { | ||
override fun use(level: Level, player: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> { | ||
if (player is ServerPlayer) { | ||
if (hand == InteractionHand.MAIN_HAND) { | ||
val dialogue: Dialogue = Dialogues.dialogues[GenerationsCore.id("rotom_catalog")] ?: return InteractionResultHolder.fail(player.mainHandItem) | ||
|
||
player.openDialogue(dialogue) | ||
|
||
return InteractionResultHolder.success(player.mainHandItem) | ||
} | ||
} | ||
return super.use(level, player, hand) | ||
} | ||
} |
149 changes: 149 additions & 0 deletions
149
common/src/main/resources/data/generations_core/dialogues/rotom_catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
{ | ||
"speakers": { | ||
"player": { | ||
"face": "q.player.face();", | ||
"name": { | ||
"type": "expression", | ||
"expression": "q.player.username" | ||
} | ||
} | ||
}, | ||
"pages": [ | ||
{ | ||
"id": "intro", | ||
"lines": [ | ||
"Which rotom slot do you wish to change form?" | ||
], | ||
"input": { | ||
"type": "option", | ||
"options": [ | ||
{ | ||
"text": "Slot 1", | ||
"value": "0", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 0)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(0);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "Slot 2", | ||
"value": "1", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 1)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(1);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "Slot 3", | ||
"value": "2", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 2)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(2);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "Slot 4", | ||
"value": "3", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 3)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(3);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "Slot 5", | ||
"value": "4", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 4)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(4);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "Slot 6", | ||
"value": "5", | ||
"isVisible": "q.player.has_in_party('cobblemon:rotom', 5)", | ||
"action": [ | ||
"v.pokemon = q.player.party.get(5);", | ||
"q.dialogue.set_page('forms');" | ||
] | ||
}, | ||
{ | ||
"text": "None Available", | ||
"value": "none", | ||
"isVisible": "!q.player.has_in_party('cobblemon:rotom')", | ||
"action": [ | ||
"q.dialogue.close();" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "forms", | ||
"lines": [ "Select form to change into:" ], | ||
"input": { | ||
"type": "option", | ||
"options": [ | ||
{ | ||
"text": "Normal", | ||
"value": "normal", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'false'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'false');", | ||
"q.dialogue.close();" | ||
] | ||
}, | ||
{ | ||
"text": "Heat", | ||
"value": "heat", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'heat'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'heat');", | ||
"q.dialogue.close();" | ||
] | ||
}, | ||
{ | ||
"text": "Wash", | ||
"value": "wash", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'wash'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'wash');", | ||
"q.dialogue.close();" | ||
] | ||
}, | ||
{ | ||
"text": "Frost", | ||
"value": "frost", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'frost'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'frost');", | ||
"q.dialogue.close();" | ||
] | ||
}, | ||
{ | ||
"text": "Fan", | ||
"value": "fan", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'fan'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'fan');", | ||
"q.dialogue.close();" | ||
] | ||
}, | ||
{ | ||
"text": "Mow", | ||
"value": "mow", | ||
"isVisible": "v.pokemon.feature('rotom_form') != 'mow'", | ||
"action": [ | ||
"v.pokemon.feature('rotom_form', 'mow');", | ||
"q.dialogue.close();" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |