mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fix some balancing and add some advancements
This commit is contained in:
parent
e08820b921
commit
3df6ceb7c8
6 changed files with 95 additions and 2 deletions
|
@ -23,6 +23,7 @@ public interface UCriteria {
|
|||
CustomEventCriterion.Trigger USE_CONSUMPTION = CUSTOM_EVENT.createTrigger("use_consumption");
|
||||
CustomEventCriterion.Trigger USE_SOULMATE = CUSTOM_EVENT.createTrigger("use_soulmate");
|
||||
CustomEventCriterion.Trigger SECOND_WIND = CUSTOM_EVENT.createTrigger("second_wind");
|
||||
CustomEventCriterion.Trigger DEFEAT_SOMBRA = CUSTOM_EVENT.createTrigger("defeat_sombra");
|
||||
|
||||
static void bootstrap() { }
|
||||
}
|
||||
|
|
|
@ -66,6 +66,9 @@ public class UnicopiaClient implements ClientModInitializer {
|
|||
|
||||
@Nullable
|
||||
private Float originalRainGradient;
|
||||
private float prevRainGradient;
|
||||
private float rainGradient;
|
||||
private float targetRainGradient;
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
|
@ -104,6 +107,7 @@ public class UnicopiaClient implements ClientModInitializer {
|
|||
world.setThunderGradient(1);
|
||||
} else {
|
||||
if (originalRainGradient != null) {
|
||||
targetRainGradient = originalRainGradient;
|
||||
world.setRainGradient(originalRainGradient);
|
||||
world.setThunderGradient(0);
|
||||
originalRainGradient = null;
|
||||
|
|
|
@ -7,7 +7,9 @@ import java.util.stream.Stream;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.USounds;
|
||||
import com.minelittlepony.unicopia.advancement.UCriteria;
|
||||
import com.minelittlepony.unicopia.entity.ai.ArenaAttackGoal;
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
import com.minelittlepony.unicopia.item.AmuletItem;
|
||||
import com.minelittlepony.unicopia.item.UItems;
|
||||
import com.minelittlepony.unicopia.particle.ParticleSource;
|
||||
|
@ -19,6 +21,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ExperienceOrbEntity;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.MovementType;
|
||||
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
|
||||
|
@ -323,8 +326,10 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
|||
);
|
||||
}
|
||||
|
||||
if (this.age % 1000 < 50) {
|
||||
((LivingEntity)target).addStatusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 26, 0, true, false));
|
||||
((LivingEntity)target).addStatusEffect(new StatusEffectInstance(StatusEffects.DARKNESS, 26, 0, true, false));
|
||||
}
|
||||
|
||||
if (getTarget() == null && target instanceof PlayerEntity player && player.distanceTo(this) < getAreaRadius() / 2F) {
|
||||
setTarget(player);
|
||||
|
@ -433,11 +438,28 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
|||
VecHelper.findInRange(this, getWorld(), home.toCenterPos(), getAreaRadius() - 0.2F, e -> e instanceof CrystalShardsEntity).forEach(e -> {
|
||||
((CrystalShardsEntity)e).setDecaying(true);
|
||||
});
|
||||
|
||||
for (Entity e : VecHelper.findInRange(this, getWorld(), home.toCenterPos(), getAreaRadius() - 0.2F, EFFECT_TARGET_PREDICATE)) {
|
||||
Pony.of(e).ifPresent(pony -> {
|
||||
pony.getCorruption().set(0);
|
||||
UCriteria.DEFEAT_SOMBRA.trigger(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
super.onDeath(damageSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops) {
|
||||
super.dropEquipment(source, lootingMultiplier, allowDrops);
|
||||
ItemEntity itemEntity = dropItem(UItems.BROKEN_ALICORN_AMULET);
|
||||
if (itemEntity != null) {
|
||||
itemEntity.setCovetedItem();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updatePostDeath() {
|
||||
if (++deathTime >= 180 && deathTime <= 200) {
|
||||
|
|
|
@ -883,6 +883,13 @@
|
|||
"advancements.unicopia.deter_phantom.title": "What Flies Around",
|
||||
"advancements.unicopia.deter_phantom.description": "Get up there and give those phantoms a taste of their own medicine",
|
||||
|
||||
"advancements.unicopia.love_is_power.title": "Love is Power",
|
||||
"advancements.unicopia.love_is_power.description": "Banish King Sombra with a Crystal Heart",
|
||||
"advancements.unicopia.save_the_day.title": "Save the Day",
|
||||
"advancements.unicopia.save_the_day.description": "Defeat King Sombra once and for all",
|
||||
"advancements.unicopia.doctor_sombrero.title": "Doctor Sombrero",
|
||||
"advancements.unicopia.doctor_sombrero.description": "That's not mare-iachi!",
|
||||
|
||||
"unicopia.toast.discoveries.title": "New Discoveries!",
|
||||
"unicopia.toast.discoveries.description": "Check your spellbook"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"parent": "unicopia:unicopia/save_the_day",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "unicopia:broken_alicorn_amulet"
|
||||
},
|
||||
"title": {
|
||||
"translate": "advancements.unicopia.doctor_sombrero.title"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancements.unicopia.doctor_sombrero.description"
|
||||
},
|
||||
"frame": "challenge",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": true
|
||||
},
|
||||
"criteria": {
|
||||
"defeat_sombra": {
|
||||
"trigger": "unicopia:custom",
|
||||
"conditions": {
|
||||
"event": "defeat_sombra",
|
||||
"repeats": 2
|
||||
}
|
||||
},
|
||||
},
|
||||
"requirements": [
|
||||
[ "defeat_sombra" ]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"parent": "unicopia:unicopia/root",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "unicopia:broken_alicorn_amulet"
|
||||
},
|
||||
"title": {
|
||||
"translate": "advancements.unicopia.save_the_day.title"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancements.unicopia.save_the_day.description"
|
||||
},
|
||||
"frame": "goal",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false
|
||||
},
|
||||
"criteria": {
|
||||
"defeat_sombra": {
|
||||
"trigger": "unicopia:custom",
|
||||
"conditions": {
|
||||
"event": "defeat_sombra"
|
||||
}
|
||||
},
|
||||
},
|
||||
"requirements": [
|
||||
[ "defeat_sombra" ]
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue