Remove useless effects for now
This commit is contained in:
@@ -21,7 +21,7 @@ export interface EffectType {
|
||||
on_removed?(entity: LivingEntity, amplifier: number): void;
|
||||
}
|
||||
|
||||
// every n ticks, n halving with each level: minecraft's regeneration, poison and wither
|
||||
// every n ticks, n halving with each level: minecraft's regeneration and poison
|
||||
const every = (ticks: number) => (duration: number, amplifier: number) => {
|
||||
const interval = ticks >> amplifier;
|
||||
return interval > 0 ? duration % interval === 0 : true;
|
||||
@@ -38,19 +38,6 @@ export const EFFECTS = {
|
||||
slowness: effect("slowness", false, {
|
||||
modifiers: [{ attribute: ATTRIBUTES.movement_speed, amount: -0.15, operation: "add_multiplied_total" }],
|
||||
}),
|
||||
strength: effect("strength", true, {
|
||||
modifiers: [{ attribute: ATTRIBUTES.attack_damage, amount: 3, operation: "add_value" }],
|
||||
}),
|
||||
weakness: effect("weakness", false, {
|
||||
modifiers: [{ attribute: ATTRIBUTES.attack_damage, amount: -4, operation: "add_value" }],
|
||||
}),
|
||||
jump_boost: effect("jump_boost", true, {
|
||||
modifiers: [{ attribute: ATTRIBUTES.safe_fall_distance, amount: 1, operation: "add_value" }],
|
||||
}),
|
||||
health_boost: effect("health_boost", true, {
|
||||
modifiers: [{ attribute: ATTRIBUTES.max_health, amount: 4, operation: "add_value" }],
|
||||
on_removed: (entity) => entity.health = Math.min(entity.health, entity.max_health),
|
||||
}),
|
||||
regeneration: effect("regeneration", true, {
|
||||
should_tick: every(50),
|
||||
on_tick: (entity) => {
|
||||
@@ -64,24 +51,13 @@ export const EFFECTS = {
|
||||
if (entity.health > 1) entity.hurt(1, DAMAGE.magic);
|
||||
},
|
||||
}),
|
||||
wither: effect("wither", false, {
|
||||
should_tick: every(40),
|
||||
on_tick: (entity) => void entity.hurt(1, DAMAGE.wither),
|
||||
}),
|
||||
instant_health: effect("instant_health", true, {
|
||||
instant: true,
|
||||
apply_instant: (entity, amplifier) => entity.heal(Math.max(4 << amplifier, 0)),
|
||||
}),
|
||||
instant_damage: effect("instant_damage", false, {
|
||||
instant: true,
|
||||
apply_instant: (entity, amplifier) => void entity.hurt(Math.max(6 << amplifier, 0), DAMAGE.magic),
|
||||
}),
|
||||
// these do their thing where it happens: LivingEntity's damage, air and travel, and synced data
|
||||
// these do their thing where it happens: LivingEntity's damage and air
|
||||
resistance: effect("resistance", true),
|
||||
fire_resistance: effect("fire_resistance", true),
|
||||
water_breathing: effect("water_breathing", true),
|
||||
slow_falling: effect("slow_falling", true),
|
||||
glowing: effect("glowing", false),
|
||||
} satisfies Record<string, EffectType>;
|
||||
|
||||
const registry = new Map<string, EffectType>(Object.values(EFFECTS).map((type) => [type.id, type]));
|
||||
|
||||
Reference in New Issue
Block a user