mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Add an advancement: A Falling Wizard
This commit is contained in:
parent
f8fc9467be
commit
ea813c3dcb
4 changed files with 42 additions and 6 deletions
|
@ -8,6 +8,7 @@ import com.minelittlepony.unicopia.ability.data.Hit;
|
|||
import com.minelittlepony.unicopia.ability.data.Pos;
|
||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType;
|
||||
import com.minelittlepony.unicopia.advancement.UCriteria;
|
||||
import com.minelittlepony.unicopia.block.state.StatePredicate;
|
||||
import com.minelittlepony.unicopia.entity.Living;
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
|
@ -163,16 +164,19 @@ public class UnicornTeleportAbility implements Ability<Pos> {
|
|||
|
||||
Vec3d dest = destination.vec().add(offset);
|
||||
|
||||
participant.teleport(
|
||||
dest.x,
|
||||
getTargetYPosition(participant.getEntityWorld(), BlockPos.ofFloored(dest), ShapeContext.of(participant)),
|
||||
dest.z
|
||||
);
|
||||
dest = new Vec3d(dest.x, getTargetYPosition(participant.getEntityWorld(), BlockPos.ofFloored(dest), ShapeContext.of(participant)), dest.z);
|
||||
|
||||
participant.teleport(dest.x, dest.y, dest.z);
|
||||
teleporter.subtractEnergyCost(distance);
|
||||
|
||||
participant.fallDistance /= distance;
|
||||
|
||||
participant.getWorld().playSound(null, destination.pos(), USounds.ENTITY_PLAYER_UNICORN_TELEPORT, SoundCategory.PLAYERS, 1, 1);
|
||||
BlockPos blockPos = BlockPos.ofFloored(dest);
|
||||
|
||||
participant.getWorld().playSound(null, blockPos, USounds.ENTITY_PLAYER_UNICORN_TELEPORT, SoundCategory.PLAYERS, 1, 1);
|
||||
if (!participant.getEntityWorld().isInBuildLimit(blockPos)) {
|
||||
UCriteria.TELEPORT_ABOVE_WORLD.trigger(teleporter.asEntity());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public interface UCriteria {
|
|||
CustomEventCriterion.Trigger POWER_UP_HEART = CUSTOM_EVENT.createTrigger("power_up_heart");
|
||||
CustomEventCriterion.Trigger SPLIT_SEA = CUSTOM_EVENT.createTrigger("split_sea");
|
||||
CustomEventCriterion.Trigger RIDE_BALLOON = CUSTOM_EVENT.createTrigger("ride_balloon");
|
||||
CustomEventCriterion.Trigger TELEPORT_ABOVE_WORLD = CUSTOM_EVENT.createTrigger("teleport_above_world");
|
||||
|
||||
static void bootstrap() { }
|
||||
}
|
||||
|
|
|
@ -1180,6 +1180,8 @@
|
|||
"advancements.unicopia.tempted.description": "Put on the alicorn amulet",
|
||||
"advancements.unicopia.hello_darkness_my_old_friend.title": "Hello Darkness...",
|
||||
"advancements.unicopia.hello_darkness_my_old_friend.description": "Delve further into the powers of the dark side",
|
||||
"advancements.unicopia.a_falling_wizard.title": "A Falling Wizard",
|
||||
"advancements.unicopia.a_falling_wizard.description": "A unicorn tried to perform an unsuccessful flying spell",
|
||||
|
||||
"advancements.unicopia.split_the_sea.title": "Who are you? Moses?",
|
||||
"advancements.unicopia.split_the_sea.description": "Use magic to displace over 100 blocks of water in one go",
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"parent": "unicopia:unicopia/unicorn/magical_route",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "unicopia:pegasus_amulet"
|
||||
},
|
||||
"title": {
|
||||
"translate": "advancements.unicopia.a_falling_wizard.title"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancements.unicopia.a_falling_wizard.description"
|
||||
},
|
||||
"frame": "challenge",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": true
|
||||
},
|
||||
"criteria": {
|
||||
"teleport_above_world": {
|
||||
"trigger": "unicopia:custom",
|
||||
"conditions": {
|
||||
"event": "teleport_above_world"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[ "teleport_above_world" ]
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue