Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regen to depend on Health module #12

Merged
merged 4 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.terasology.entitySystem.systems.BaseComponentSystem;
import org.terasology.entitySystem.systems.RegisterMode;
import org.terasology.entitySystem.systems.RegisterSystem;
import org.terasology.logic.health.BeforeDamagedEvent;
import org.terasology.logic.health.event.BeforeDamagedEvent;
import org.terasology.world.block.BlockComponent;
import org.terasology.world.block.BlockUri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.terasology.entitySystem.systems.RegisterSystem;
import org.terasology.entitySystem.systems.UpdateSubscriberSystem;
import org.terasology.logic.delay.DelayedActionTriggeredEvent;
import org.terasology.logic.health.DoDamageEvent;
import org.terasology.logic.health.event.DoDamageEvent;
import org.terasology.logic.health.HealthComponent;
import org.terasology.registry.In;
import org.terasology.utilities.Assets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.terasology.entitySystem.systems.BaseComponentSystem;
import org.terasology.entitySystem.systems.RegisterMode;
import org.terasology.entitySystem.systems.RegisterSystem;
import org.terasology.logic.health.BeforeHealEvent;
import org.terasology.logic.health.event.BeforeRestoreEvent;

/**
* This authority system handles events for entities with the decover effect.
Expand All @@ -35,7 +35,7 @@ public class DecoverAuthoritySystem extends BaseComponentSystem {
* @param component The decover component added to entities with the decover effect.
*/
@ReceiveEvent
public void cancelHeal(BeforeHealEvent event, EntityRef entity, DecoverComponent component) {
public void cancelHeal(BeforeRestoreEvent event, EntityRef entity, DecoverComponent component) {
event.consume();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.terasology.engine.Time;
import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.logic.delay.DelayManager;
import org.terasology.logic.health.event.ActivateRegenEvent;
import org.terasology.math.TeraMath;

/**
Expand Down Expand Up @@ -124,12 +125,15 @@ else if (!modifiersFound || !effectModifyEvent.getHasInfDuration()) {
*
* @param instigator The entity who applied the regen effect.
* @param entity The entity that the regen effect is being applied on.
* @param id Inapplicable to the regen effect.
* @param id Id is used for unique identification in regen scheduler.
* @param magnitude The magnitude of the regen effect.
* @param duration The duration of the regen effect.
*/
@Override
public void applyEffect(EntityRef instigator, EntityRef entity, String id, float magnitude, long duration) {
applyEffect(instigator, entity, magnitude, duration);
//applyEffect(instigator, entity, magnitude, duration);
if (magnitude != 0) {
entity.send(new ActivateRegenEvent(id, magnitude, ((float) duration) / 1000));
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.terasology.entitySystem.systems.RegisterMode;
import org.terasology.entitySystem.systems.RegisterSystem;
import org.terasology.logic.delay.DelayedActionTriggeredEvent;
import org.terasology.logic.health.BeforeDamagedEvent;
import org.terasology.logic.health.event.BeforeDamagedEvent;
import org.terasology.registry.In;

import java.util.regex.Pattern;
Expand Down