Removed multi-class call generation
This commit is contained in:
@@ -9,7 +9,7 @@ import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.entities.effect.Fire;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
@@ -43,7 +43,7 @@ public class Damage{
|
||||
}
|
||||
|
||||
for(int i = 0; i < Mathf.clamp(flammability / 4, 0, 30); i++){
|
||||
Timers.run(i / 2, () -> CallEntity.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f)));
|
||||
Timers.run(i / 2, () -> Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f)));
|
||||
}
|
||||
|
||||
int waves = Mathf.clamp((int) (explosiveness / 4), 0, 30);
|
||||
|
||||
@@ -14,10 +14,9 @@ import io.anuke.mindustry.entities.effect.ItemDrop;
|
||||
import io.anuke.mindustry.entities.effect.ScorchDecal;
|
||||
import io.anuke.mindustry.entities.traits.*;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Trail;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetConnection;
|
||||
import io.anuke.mindustry.type.*;
|
||||
@@ -83,7 +82,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
//region unit and event overrides, utility methods
|
||||
|
||||
@Remote(in = In.entities, targets = Loc.server, called = Loc.server)
|
||||
@Remote(targets = Loc.server, called = Loc.server)
|
||||
public static void onPlayerDamage(Player player, float amount){
|
||||
if(player == null) return;
|
||||
|
||||
@@ -91,7 +90,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
player.health -= amount;
|
||||
}
|
||||
|
||||
@Remote(in = In.entities, targets = Loc.server, called = Loc.server)
|
||||
@Remote(targets = Loc.server, called = Loc.server)
|
||||
public static void onPlayerDeath(Player player){
|
||||
if(player == null) return;
|
||||
|
||||
@@ -228,10 +227,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
CallEntity.onPlayerDamage(this, calculateDamage(amount));
|
||||
Call.onPlayerDamage(this, calculateDamage(amount));
|
||||
|
||||
if(health <= 0 && !dead){
|
||||
CallEntity.onPlayerDeath(this);
|
||||
Call.onPlayerDeath(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +510,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
if(!ui.chatfrag.chatOpen() && Inputs.keyTap("drop_unit")){
|
||||
if(!mech.flying){
|
||||
if(getCarrier() != null){
|
||||
CallEntity.dropSelf(this);
|
||||
Call.dropSelf(this);
|
||||
}
|
||||
}else if(getCarry() != null){
|
||||
dropCarry();
|
||||
|
||||
@@ -10,8 +10,7 @@ import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallBlocks;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Edges;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
@@ -55,14 +54,14 @@ public class TileEntity extends BaseEntity implements TargetTrait{
|
||||
private boolean sleeping;
|
||||
private float sleepTime;
|
||||
|
||||
@Remote(called = Loc.server, in = In.blocks)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onTileDamage(Tile tile, float health){
|
||||
if(tile.entity != null){
|
||||
tile.entity.health = health;
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.blocks)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onTileDestroyed(Tile tile){
|
||||
if(tile.entity == null) return;
|
||||
tile.entity.onDeath();
|
||||
@@ -159,10 +158,10 @@ public class TileEntity extends BaseEntity implements TargetTrait{
|
||||
public void damage(float damage){
|
||||
if(dead) return;
|
||||
|
||||
CallBlocks.onTileDamage(tile, health - tile.block().handleDamage(tile, damage));
|
||||
Call.onTileDamage(tile, health - tile.block().handleDamage(tile, damage));
|
||||
|
||||
if(health <= 0){
|
||||
CallBlocks.onTileDestroyed(tile);
|
||||
Call.onTileDestroyed(tile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
||||
create(type, parent.owner, parent.team, x, y, angle, velocityScl);
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void createBullet(BulletType type, float x, float y, float angle){
|
||||
create(type, null, Team.none, x, y, angle);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ import io.anuke.mindustry.entities.Damage;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.traits.SaveTrait;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
@@ -77,7 +76,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onFireRemoved(int fireid){
|
||||
fireGroup.removeByID(fireid);
|
||||
}
|
||||
@@ -104,7 +103,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{
|
||||
time = Mathf.clamp(time + Timers.delta(), 0, lifetime());
|
||||
|
||||
if(time >= lifetime() || tile == null){
|
||||
CallEntity.onFireRemoved(getID());
|
||||
Call.onFireRemoved(getID());
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
@@ -133,7 +132,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{
|
||||
create(other);
|
||||
|
||||
if(Mathf.chance(0.05 * Timers.delta() * Mathf.clamp(flammability / 10.0))){
|
||||
CallEntity.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f));
|
||||
Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ import io.anuke.mindustry.entities.traits.SaveTrait;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.net.Interpolator;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
@@ -69,7 +68,7 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
|
||||
create(item, amount, x, y, 0).getVelocity().set(velocityX, velocityY);
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onPickup(int itemid){
|
||||
ItemDrop drop = itemGroup.getByID(itemid);
|
||||
if(drop != null){
|
||||
@@ -133,7 +132,7 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
|
||||
amount -= used;
|
||||
|
||||
if(amount <= 0){
|
||||
CallEntity.onPickup(getID());
|
||||
Call.onPickup(getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,14 +165,14 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
|
||||
updateVelocity(0.2f);
|
||||
updateTime();
|
||||
if(time >= lifetime()){
|
||||
CallEntity.onPickup(getID());
|
||||
Call.onPickup(getID());
|
||||
}
|
||||
}
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
|
||||
if(tile != null && tile.solid()){
|
||||
CallEntity.onPickup(getID());
|
||||
Call.onPickup(getID());
|
||||
}
|
||||
|
||||
if(tile != null && tile.floor().isLiquid){
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
|
||||
public ItemTransfer(){
|
||||
}
|
||||
|
||||
@Remote(in = In.entities, called = Loc.server, unreliable = true)
|
||||
@Remote(called = Loc.server, unreliable = true)
|
||||
public static void transferAmmo(Item item, float x, float y, Unit to){
|
||||
if(to == null) return;
|
||||
to.addAmmo(item);
|
||||
@@ -43,20 +43,20 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
|
||||
});
|
||||
}
|
||||
|
||||
@Remote(in = In.entities, called = Loc.server, unreliable = true)
|
||||
@Remote(called = Loc.server, unreliable = true)
|
||||
public static void transferItemEffect(Item item, float x, float y, Unit to){
|
||||
if(to == null) return;
|
||||
create(item, x, y, to, () -> {
|
||||
});
|
||||
}
|
||||
|
||||
@Remote(in = In.entities, called = Loc.server, unreliable = true)
|
||||
@Remote(called = Loc.server, unreliable = true)
|
||||
public static void transferItemToUnit(Item item, float x, float y, Unit to){
|
||||
if(to == null) return;
|
||||
create(item, x, y, to, () -> to.inventory.addItem(item, 1));
|
||||
}
|
||||
|
||||
@Remote(in = In.entities, called = Loc.server)
|
||||
@Remote(called = Loc.server)
|
||||
public static void transferItemTo(Item item, int amount, float x, float y, Tile tile){
|
||||
if(tile == null) return;
|
||||
for(int i = 0; i < Mathf.clamp(amount / 3, 1, 8); i++){
|
||||
|
||||
@@ -11,9 +11,8 @@ import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.entities.EntityGroup;
|
||||
@@ -56,10 +55,10 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
|
||||
* Create a lighting branch at a location. Use Team.none to damage everyone.
|
||||
*/
|
||||
public static void create(Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
|
||||
CallEntity.createLighting(lastSeed++, team, effect, color, damage, x, y, targetAngle, length);
|
||||
Call.createLighting(lastSeed++, team, effect, color, damage, x, y, targetAngle, length);
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void createLighting(int seed, Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
|
||||
Lightning l = Pooling.obtain(Lightning.class);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import io.anuke.mindustry.content.fx.EnvironmentFx;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.SaveTrait;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.Liquid;
|
||||
@@ -136,7 +136,7 @@ public class Puddle extends BaseEntity implements SaveTrait, Poolable, DrawTrait
|
||||
(liquid.flammability > 0.3f && dest.temperature > 0.7f)){ //flammable liquid + hot liquid
|
||||
Fire.create(tile);
|
||||
if(Mathf.chance(0.006 * amount)){
|
||||
CallEntity.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f));
|
||||
Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f));
|
||||
}
|
||||
}else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot puddle
|
||||
if(Mathf.chance(0.5f * amount)){
|
||||
@@ -152,7 +152,7 @@ public class Puddle extends BaseEntity implements SaveTrait, Poolable, DrawTrait
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onPuddleRemoved(int puddleid){
|
||||
puddleGroup.removeByID(puddleid);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ public class Puddle extends BaseEntity implements SaveTrait, Poolable, DrawTrait
|
||||
amount = Mathf.clamp(amount, 0, maxLiquid);
|
||||
|
||||
if(amount <= 0f){
|
||||
CallEntity.onPuddleRemoved(getID());
|
||||
Call.onPuddleRemoved(getID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
@@ -243,7 +243,7 @@ public interface BuilderTrait extends Entity{
|
||||
|
||||
if(unit.inventory.canAcceptItem(item) &&
|
||||
Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){
|
||||
CallEntity.transferItemToUnit(item,
|
||||
Call.transferItemToUnit(item,
|
||||
tile.worldx() + Mathf.range(tilesize / 2f),
|
||||
tile.worldy() + Mathf.range(tilesize / 2f),
|
||||
unit);
|
||||
|
||||
@@ -4,20 +4,19 @@ import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.mindustry.content.fx.UnitFx;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.entities.trait.SolidTrait;
|
||||
|
||||
public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{
|
||||
@Remote(called = Loc.both, targets = Loc.both, forward = true, in = In.entities)
|
||||
@Remote(called = Loc.both, targets = Loc.both, forward = true)
|
||||
static void dropSelf(Player player){
|
||||
if(player.getCarrier() != null){
|
||||
player.getCarrier().dropCarry();
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.both, targets = Loc.both, forward = true, in = In.entities)
|
||||
@Remote(called = Loc.both, targets = Loc.both, forward = true)
|
||||
static void setCarryOf(Player player, CarryTrait trait, CarriableTrait unit){
|
||||
if(trait == null) return;
|
||||
if(player != null){ //when a server recieves this called from a player, set the carrier to the player.
|
||||
@@ -72,6 +71,6 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{
|
||||
* Carries a unit. To drop a unit, call with {@code null}.
|
||||
*/
|
||||
default void carry(CarriableTrait unit){
|
||||
CallEntity.setCarryOf(this instanceof Player ? (Player) this : null, this, unit);
|
||||
Call.setCarryOf(this instanceof Player ? (Player) this : null, this, unit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import io.anuke.mindustry.entities.traits.SpawnerTrait;
|
||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.game.TeamInfo.TeamData;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
@@ -62,7 +62,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
public BaseUnit(){
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
@Remote(called = Loc.server)
|
||||
public static void onUnitDeath(BaseUnit unit){
|
||||
if(unit == null) return;
|
||||
|
||||
@@ -370,7 +370,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
|
||||
@Override
|
||||
public void onDeath(){
|
||||
CallEntity.onUnitDeath(this);
|
||||
Call.onUnitDeath(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.entities.units.FlyingUnit;
|
||||
import io.anuke.mindustry.entities.units.UnitState;
|
||||
import io.anuke.mindustry.game.EventType.BlockBuildEvent;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
@@ -227,7 +227,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
|
||||
if(distanceTo(target) < type.range){
|
||||
if(tile.tile.block().acceptStack(inventory.getItem().item, inventory.getItem().amount, tile.tile, Drone.this) == inventory.getItem().amount){
|
||||
CallEntity.transferItemTo(inventory.getItem().item, inventory.getItem().amount, x, y, tile.tile);
|
||||
Call.transferItemTo(inventory.getItem().item, inventory.getItem().amount, x, y, tile.tile);
|
||||
inventory.clearItem();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
float dist = Math.min(entity.distanceTo(x, y) - placeDistance, 0);
|
||||
|
||||
if(dist / type.maxVelocity < timeToBuild * 0.9f){
|
||||
//CallEntity.onDroneBeginBuild(this, entity.tile, entity.recipe);
|
||||
//Call.onDroneBeginBuild(this, entity.tile, entity.recipe);
|
||||
target = entity;
|
||||
setState(build);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user