Apply BASE new MapLabels feature
This commit is contained in:
BIN
animations/c8883e76-ae93-4673-8893-d2ec72c1e199.png
Normal file
BIN
animations/c8883e76-ae93-4673-8893-d2ec72c1e199.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
23
data.sql
23
data.sql
@@ -101,14 +101,16 @@ INSERT INTO "PUBLIC"."ENEMY_DROP" VALUES
|
||||
(9, 'skeleton_archer', 'ranged:wooden_bow', 0.3, '1'),
|
||||
(10, 'skeleton_archer', 'ammo:wooden_arrow', 0.7, '1d4+3'),
|
||||
(11, 'deku', 'junk:eye', 0.7, '1d2');
|
||||
CREATE MEMORY TABLE "PUBLIC"."START_GAME"(
|
||||
"ID" SMALLINT NOT NULL,
|
||||
"START_POINT" VARCHAR NOT NULL
|
||||
);
|
||||
ALTER TABLE "PUBLIC"."START_GAME" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_C0" PRIMARY KEY("ID");
|
||||
-- 1 +/- SELECT COUNT(*) FROM PUBLIC.START_GAME;
|
||||
INSERT INTO "PUBLIC"."START_GAME" VALUES
|
||||
(1, 'Forrest,Main,1,12');
|
||||
CREATE MEMORY TABLE "PUBLIC"."CONFIG"(
|
||||
"KEY" VARCHAR NOT NULL,
|
||||
"VALUE" VARCHAR
|
||||
);
|
||||
ALTER TABLE "PUBLIC"."CONFIG" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_7" PRIMARY KEY("KEY");
|
||||
-- 3 +/- SELECT COUNT(*) FROM PUBLIC.CONFIG;
|
||||
INSERT INTO "PUBLIC"."CONFIG" VALUES
|
||||
('start_game', 'Hero Home,Main,Start'),
|
||||
('screen', '1000x800'),
|
||||
('camera_scale', '2');
|
||||
CREATE MEMORY TABLE "PUBLIC"."LEVELS"(
|
||||
"LEVEL" INT DEFAULT NEXT VALUE FOR "PUBLIC"."SYSTEM_SEQUENCE_704587BB_DC0E_44AB_A7F0_3DE0CA44FE3F" NOT NULL NULL_TO_DEFAULT SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_704587BB_DC0E_44AB_A7F0_3DE0CA44FE3F",
|
||||
"MAX_HP" VARCHAR NOT NULL
|
||||
@@ -132,9 +134,10 @@ CREATE MEMORY TABLE "PUBLIC"."THROWING_WEAPON"(
|
||||
"ICON" VARCHAR NOT NULL
|
||||
);
|
||||
ALTER TABLE "PUBLIC"."THROWING_WEAPON" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_40" PRIMARY KEY("ID");
|
||||
-- 1 +/- SELECT COUNT(*) FROM PUBLIC.THROWING_WEAPON;
|
||||
-- 2 +/- SELECT COUNT(*) FROM PUBLIC.THROWING_WEAPON;
|
||||
INSERT INTO "PUBLIC"."THROWING_WEAPON" VALUES
|
||||
('deku_arrow', 'Deku''s arrow', 500, '2d4', 'Arrow', 'Arrow', '5d4', 'Punch', 'Arrow punch', 'Poof', 'Arrow punch', 'Generic,8,10');
|
||||
('deku_arrow', 'Deku''s arrow', 500, '2d4', 'Arrow', 'Arrow', '5d4', 'Punch', 'Arrow punch', 'Poof', 'Arrow punch', 'Generic,8,10'),
|
||||
('shuriken', 'Shuriken', 100, '3d6', 'Shuriken', 'Arrow', '5d4', 'Punch', 'Arrow punch', 'Poof', 'Arrow punch', 'Generic,9,2');
|
||||
CREATE MEMORY TABLE "PUBLIC"."ENEMY"(
|
||||
"ID" VARCHAR NOT NULL,
|
||||
"NAME" VARCHAR NOT NULL,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
BIN
project.bep
BIN
project.bep
Binary file not shown.
@@ -4,6 +4,9 @@ import com.bartlomiejpluta.demo.world.item.Item;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class Chest extends MapObject {
|
||||
@@ -29,4 +32,30 @@ public class Chest extends MapObject {
|
||||
|
||||
throw new IllegalStateException("Chest is full!");
|
||||
}
|
||||
|
||||
public Chest addItem(Item item, int slot) {
|
||||
if(slot >= content.length) {
|
||||
throw new IllegalStateException("The [" + slot + "] slot exceeds the chest size (" + content.length + ")!");
|
||||
}
|
||||
|
||||
if (content[slot] != null) {
|
||||
throw new IllegalStateException("The [" + slot + "] slot is already filled!");
|
||||
}
|
||||
|
||||
content[slot] = item;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Chest shuffle() {
|
||||
var random = new Random();
|
||||
for(int i = content.length - 1; i > 0; --i) {
|
||||
var index = random.nextInt(i + 1);
|
||||
var tmp = content[index];
|
||||
content[index] = content[i];
|
||||
content[i] = tmp;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.bartlomiejpluta.demo.entity;
|
||||
|
||||
import A.maps;
|
||||
import com.bartlomiejpluta.base.api.map.layer.object.MapPin;
|
||||
import com.bartlomiejpluta.demo.runner.DemoRunner;
|
||||
import lombok.NonNull;
|
||||
|
||||
@@ -13,12 +14,23 @@ public class Door extends MapObject {
|
||||
private final int layerId;
|
||||
private final Player player;
|
||||
|
||||
public Door(@NonNull MapPin label, @NonNull String id) {
|
||||
super(id);
|
||||
this.mapUid = label.getMap();
|
||||
this.layerId = label.getLayer();
|
||||
this.targetX = label.getX();
|
||||
this.targetY = label.getY();
|
||||
player = DemoRunner.instance().getPlayer();
|
||||
setPositionOffset(0, 16);
|
||||
}
|
||||
|
||||
public Door(@NonNull String mapName, @NonNull String layerName, int targetX, int targetY, @NonNull String id) {
|
||||
super(id);
|
||||
this.mapUid = maps.get(mapName).uid;
|
||||
var map = maps.byName(mapName);
|
||||
this.mapUid = map.$;
|
||||
this.targetX = targetX;
|
||||
this.targetY = targetY;
|
||||
this.layerId = maps.getLayer(mapName, layerName);
|
||||
this.layerId = map.layer(layerName).$;
|
||||
player = DemoRunner.instance().getPlayer();
|
||||
setPositionOffset(0, 16);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Enemy extends Creature implements NPC {
|
||||
}
|
||||
|
||||
public Enemy(@NonNull DB.model.EnemyModel template) {
|
||||
super(ContextHolder.INSTANCE.getContext().createCharacter(A.charsets.get(template.getCharset()).uid));
|
||||
super(ContextHolder.INSTANCE.getContext().createCharacter(A.charsets.byName(template.getCharset()).$));
|
||||
this.template = template;
|
||||
name = template.getName();
|
||||
maxHp = DiceRoller.roll(template.getHp());
|
||||
@@ -78,7 +78,7 @@ public class Enemy extends Creature implements NPC {
|
||||
this.throwingWeapon = new ThrowingWeapon(split[0], DiceRoller.roll(split[1]));
|
||||
}
|
||||
|
||||
this.dieAnimation = new SimpleAnimationRunner(A.animations.get(template.getDieAnimation()).uid);
|
||||
this.dieAnimation = new SimpleAnimationRunner(A.animations.byName(template.getDieAnimation()).$);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +94,7 @@ public class Enemy extends Creature implements NPC {
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
changeCharacterSet(A.charsets.get(template.getDeadCharset()).uid);
|
||||
changeCharacterSet(A.charsets.byName(template.getDeadCharset()).$);
|
||||
setScale(0.5f);
|
||||
setBlocking(false);
|
||||
setZIndex(-1);
|
||||
@@ -102,7 +102,7 @@ public class Enemy extends Creature implements NPC {
|
||||
ai = NoopAI.INSTANCE;
|
||||
|
||||
dieAnimation.run(context, getLayer(), this);
|
||||
context.playSound(A.sounds.get(template.getDieSound()).uid);
|
||||
context.playSound(A.sounds.byName(template.getDieSound()).$);
|
||||
context.fireEvent(new EnemyDiedEvent(this));
|
||||
|
||||
LootGenerator.generate(template.getId(), loot);
|
||||
|
||||
@@ -22,11 +22,11 @@ public abstract class MapObject extends com.bartlomiejpluta.base.util.world.MapO
|
||||
}
|
||||
|
||||
public MapObject(@NonNull DB.model.ObjectModel template) {
|
||||
super(ContextHolder.INSTANCE.getContext().createCharacter(A.charsets.get(template.getCharset()).uid), template.getFrame());
|
||||
super(ContextHolder.INSTANCE.getContext().createCharacter(A.charsets.byName(template.getCharset()).$), template.getFrame());
|
||||
this.context = ContextHolder.INSTANCE.getContext();
|
||||
this.runner = DemoRunner.instance();
|
||||
this.name = template.getName();
|
||||
this.interactSound = A.sounds.get(template.getInteractSound()).uid;
|
||||
this.interactSound = A.sounds.byName(template.getInteractSound()).$;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Player extends Creature {
|
||||
this.hp = this.maxHp;
|
||||
|
||||
alive = true;
|
||||
changeCharacterSet(A.charsets.luna.uid);
|
||||
changeCharacterSet(A.charsets.luna.$);
|
||||
setScale(1f);
|
||||
setSpeed(4f);
|
||||
setAnimationSpeed(1f);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class EquipmentWindow extends DecoratedWindow {
|
||||
public EquipmentWindow(Context context, GUI gui, Map<String, Component> refs) {
|
||||
super(context, gui, refs);
|
||||
this.player = DemoRunner.instance().getPlayer();
|
||||
this.popupMenuWindow = gui.inflateWindow(A.widgets.eq_item_menu.uid);
|
||||
this.popupMenuWindow = gui.inflateWindow(A.widgets.eq_item_menu.$);
|
||||
this.popupMenu = popupMenuWindow.reference("menu", VOptionChoice.class);
|
||||
this.useBtn = popupMenuWindow.reference("use", Button.class);
|
||||
this.dropBtn = popupMenuWindow.reference("drop", Button.class);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ItemIconView extends IconView {
|
||||
@Attribute(value = "placeholder", separator = ",")
|
||||
public void setPlaceholderIcon(String icon, int row, int column) {
|
||||
this.placeholderIconPaint = gui.createPaint();
|
||||
this.placeholderIconSet = gui.getIconSet(A.iconsets.get(icon).uid);
|
||||
this.placeholderIconSet = gui.getIconSet(A.iconsets.byName(icon).$);
|
||||
this.placeholderIconSetRow = row;
|
||||
this.placeholderIconSetColumn = column;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class ItemIconView extends IconView {
|
||||
|
||||
if (item != null && item instanceof ItemStack stack) {
|
||||
gui.beginPath();
|
||||
gui.setFontFace(fonts.roboto_regular.uid);
|
||||
gui.setFontFace(fonts.roboto_regular.$);
|
||||
gui.setFontSize(17);
|
||||
gui.putText(x + 15, y + 5, String.valueOf(stack.getCount()));
|
||||
gui.setFillColor(textColor);
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.bartlomiejpluta.demo.map;
|
||||
|
||||
import A.maps;
|
||||
import com.bartlomiejpluta.base.api.camera.Camera;
|
||||
import com.bartlomiejpluta.base.api.context.Context;
|
||||
import com.bartlomiejpluta.base.api.entity.Entity;
|
||||
import com.bartlomiejpluta.base.api.gui.Window;
|
||||
import com.bartlomiejpluta.base.api.gui.WindowPosition;
|
||||
import com.bartlomiejpluta.base.api.icon.Icon;
|
||||
import com.bartlomiejpluta.base.api.input.Input;
|
||||
import com.bartlomiejpluta.base.api.input.Key;
|
||||
import com.bartlomiejpluta.base.api.map.handler.MapHandler;
|
||||
import com.bartlomiejpluta.base.api.map.layer.object.MapPin;
|
||||
import com.bartlomiejpluta.base.api.map.layer.object.ObjectLayer;
|
||||
import com.bartlomiejpluta.base.api.map.model.GameMap;
|
||||
import com.bartlomiejpluta.base.api.move.Direction;
|
||||
@@ -87,63 +90,42 @@ public abstract class BaseMapHandler implements MapHandler {
|
||||
return guiManager.showDialog(message, WindowPosition.BOTTOM);
|
||||
}
|
||||
|
||||
public Enemy enemy(@NonNull String id) {
|
||||
return new Enemy(id);
|
||||
protected <T extends Entity> T addEntity(T entity, MapPin tile) {
|
||||
entity.setCoordinates(tile.getX(), tile.getY());
|
||||
map.getObjectLayer(tile.getLayer()).addEntity(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Enemy enemy(ObjectLayer layer, int x, int y, @NonNull String id) {
|
||||
var enemy = new Enemy(id);
|
||||
enemy.setCoordinates(x, y);
|
||||
layer.addEntity(enemy);
|
||||
return enemy;
|
||||
public Enemy enemy(@NonNull MapPin tile, @NonNull String id) {
|
||||
return addEntity(new Enemy(id), tile);
|
||||
}
|
||||
|
||||
public Chest chest(ObjectLayer layer, int x, int y, @NonNull String id) {
|
||||
var chest = new Chest(id);
|
||||
chest.setCoordinates(x, y);
|
||||
layer.addEntity(chest);
|
||||
return chest;
|
||||
public Chest chest(@NonNull MapPin tile, @NonNull String id) {
|
||||
return addEntity(new Chest(id), tile);
|
||||
}
|
||||
|
||||
public Door door(ObjectLayer layer, int x, int y, @NonNull String mapName, @NonNull String layerName, int targetX, int targetY, @NonNull String id) {
|
||||
var door = new Door(mapName, layerName, targetX, targetY, id);
|
||||
door.setCoordinates(x, y);
|
||||
layer.addEntity(door);
|
||||
return door;
|
||||
public Door door(@NonNull MapPin tile, @NonNull MapPin target, @NonNull String id) {
|
||||
return addEntity(new Door(target, id), tile);
|
||||
}
|
||||
|
||||
public CharacterSpawner spawner(ObjectLayer layer, int x, int y) {
|
||||
var spawner = new CharacterSpawner().trackEntities(EnemyDiedEvent.TYPE);
|
||||
spawner.setCoordinates(x, y);
|
||||
layer.addEntity(spawner);
|
||||
return spawner;
|
||||
public CharacterSpawner spawner(@NonNull MapPin tile) {
|
||||
return addEntity(new CharacterSpawner().trackEntities(EnemyDiedEvent.TYPE), tile);
|
||||
}
|
||||
|
||||
public Medicament medicament(@NonNull String id, int count) {
|
||||
return new Medicament(id, count);
|
||||
public Medicament medicament(@NonNull MapPin tile, @NonNull String id, int count) {
|
||||
return addEntity(new Medicament(id, count), tile);
|
||||
}
|
||||
|
||||
public Medicament medicament(ObjectLayer layer, int x, int y, @NonNull String id, int count) {
|
||||
var medicament = new Medicament(id, count);
|
||||
medicament.setCoordinates(x, y);
|
||||
layer.addEntity(medicament);
|
||||
return medicament;
|
||||
}
|
||||
|
||||
public Icon icon(ObjectLayer layer, int x, int y, String iconSetUid, int row, int column) {
|
||||
public Icon icon(@NonNull MapPin tile, String iconSetUid, int row, int column) {
|
||||
var icon = context.createIcon(iconSetUid, row, column);
|
||||
icon.setScale(1f);
|
||||
icon.setZIndex(-1);
|
||||
icon.setCoordinates(x, y);
|
||||
layer.addEntity(icon);
|
||||
return icon;
|
||||
return addEntity(icon, tile);
|
||||
}
|
||||
|
||||
public Warp warp(ObjectLayer layer, int x, int y, String targetMap, String targetLayer, int targetX, int targetY) {
|
||||
var warp = new Warp(A.maps.get(targetMap).uid, A.maps.getLayer(targetMap, targetLayer), targetX, targetY);
|
||||
public Warp warp(@NonNull MapPin tile, MapPin target) {
|
||||
var warp = new Warp(target);
|
||||
warp.setEntity(player);
|
||||
warp.setCoordinates(x, y);
|
||||
layer.addEntity(warp);
|
||||
return warp;
|
||||
return addEntity(warp, tile);
|
||||
}
|
||||
}
|
||||
@@ -36,20 +36,20 @@ public class GuiManager {
|
||||
|
||||
this.gui.setRoot(this.manager);
|
||||
|
||||
this.startMenu = gui.inflateWindow(A.widgets.start_menu.uid, StartMenuWindow.class);
|
||||
this.startMenu = gui.inflateWindow(A.widgets.start_menu.$, StartMenuWindow.class);
|
||||
this.startMenu.reference("new_game", Button.class).setAction(runner::newGame);
|
||||
this.startMenu.reference("exit", Button.class).setAction(runner::exit);
|
||||
|
||||
this.equipment = gui.inflateWindow(A.widgets.equipment.uid, EquipmentWindow.class);
|
||||
this.equipment = gui.inflateWindow(A.widgets.equipment.$, EquipmentWindow.class);
|
||||
|
||||
this.gameMenu = gui.inflateWindow(A.widgets.game_menu.uid, GameMenuWindow.class);
|
||||
this.gameMenu = gui.inflateWindow(A.widgets.game_menu.$, GameMenuWindow.class);
|
||||
this.gameMenu.reference("resume_game", Button.class).setAction(this::resumeGame);
|
||||
this.gameMenu.reference("equipment", Button.class).setAction(() -> manager.open(equipment));
|
||||
this.gameMenu.reference("start_menu", Button.class).setAction(runner::returnToStartMenu);
|
||||
this.gameMenu.reference("exit", Button.class).setAction(runner::exit);
|
||||
|
||||
this.dialog = gui.inflateWindow(A.widgets.dialog.uid, DialogWindow.class);
|
||||
this.loot = gui.inflateWindow(widgets.loot_menu.uid, LootWindow.class);
|
||||
this.dialog = gui.inflateWindow(A.widgets.dialog.$, DialogWindow.class);
|
||||
this.loot = gui.inflateWindow(widgets.loot_menu.$, LootWindow.class);
|
||||
}
|
||||
|
||||
private void handleGameMenuKeyEvent(KeyEvent event) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.bartlomiejpluta.demo.runner;
|
||||
|
||||
import A.maps;
|
||||
import DB.ConfigDAO;
|
||||
import DB.dao;
|
||||
import com.bartlomiejpluta.base.api.context.Context;
|
||||
import com.bartlomiejpluta.base.api.gui.GUI;
|
||||
@@ -34,12 +36,15 @@ public class DemoRunner implements GameRunner {
|
||||
|
||||
private void configureScreen() {
|
||||
var resolution = screen.getCurrentResolution();
|
||||
screen.setSize(800, 600);
|
||||
screen.setPosition((resolution.x() - 1800) / 2, (resolution.y() - 1000) / 2);
|
||||
var config = dao.config.find("screen").getValue().split("x");
|
||||
var width = Integer.parseInt(config[0]);
|
||||
var height = Integer.parseInt(config[1]);
|
||||
screen.setSize(width, height);
|
||||
screen.setPosition((resolution.x() - width) / 2, (resolution.y() - height) / 2);
|
||||
}
|
||||
|
||||
private void configureCamera() {
|
||||
context.getCamera().setScale(2.5f);
|
||||
context.getCamera().setScale(Float.parseFloat(dao.config.find("camera_scale").getValue()));
|
||||
}
|
||||
|
||||
private void initMenu() {
|
||||
@@ -49,12 +54,12 @@ public class DemoRunner implements GameRunner {
|
||||
private void initHUD() {
|
||||
hud = context.newGUI();
|
||||
hud.hide();
|
||||
var hudComponent = hud.inflateComponent(A.widgets.hud.uid);
|
||||
var hudComponent = hud.inflateComponent(A.widgets.hud.$);
|
||||
hud.setRoot(hudComponent);
|
||||
}
|
||||
|
||||
private void initPlayer() {
|
||||
this.player = new Player(context.createCharacter(A.charsets.luna.uid));
|
||||
this.player = new Player(context.createCharacter(A.charsets.luna.$));
|
||||
}
|
||||
|
||||
public void newGame() {
|
||||
@@ -62,13 +67,19 @@ public class DemoRunner implements GameRunner {
|
||||
guiManager.closeAll();
|
||||
guiManager.enableGameMenu();
|
||||
player.reset();
|
||||
var start = dao.start_game.find((short) 1);
|
||||
var startPoint = start.getStartPoint().split(",");
|
||||
context.openMap(A.maps.get(startPoint[0]).uid);
|
||||
context.getMap().getObjectLayer(A.maps.getLayer(startPoint[0], startPoint[1])).addEntity(this.player);
|
||||
player.setCoordinates(parseInt(startPoint[2]), parseInt(startPoint[3]));
|
||||
var start = dao.config.find("start_game").getValue().split(",");
|
||||
|
||||
var map = A.maps.byName(start[0]);
|
||||
var layer = map.layer(start[1]);
|
||||
var label = layer.label(start[2]);
|
||||
|
||||
context.openMap(map.$);
|
||||
context.getMap().getObjectLayer(layer.$).addEntity(this.player);
|
||||
player.setCoordinates(label.getX(), label.getY());
|
||||
context.resume();
|
||||
hud.show();
|
||||
|
||||
var x = A.maps.hero_home.main.entry;
|
||||
}
|
||||
|
||||
public void returnToStartMenu() {
|
||||
|
||||
@@ -6,6 +6,6 @@ import com.bartlomiejpluta.base.api.icon.Icon;
|
||||
public class IconUtil {
|
||||
public static Icon parseIcon(String iconDefinition) {
|
||||
var parts = iconDefinition.split(",");
|
||||
return ContextHolder.INSTANCE.getContext().createIcon(A.iconsets.get(parts[0]).uid, Integer.parseInt(parts[1]), Integer.parseInt(parts[2]));
|
||||
return ContextHolder.INSTANCE.getContext().createIcon(A.iconsets.byName(parts[0]).$, Integer.parseInt(parts[1]), Integer.parseInt(parts[2]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public class MeleeWeapon extends BaseItem implements Weapon {
|
||||
this.name = template.getName();
|
||||
this.dmgRoller = DiceRoller.of(template.getDamage());
|
||||
this.cooldown = template.getCooldown();
|
||||
this.animation = new RandomAnimationsRunner(2).nRange(0, 2f).nScale(0.2f, 0.15f).uAnimationSpeed(0.5f, 1f).nRotation(0, 10).offset(0, -10).uDelay(250, 500).with(A.animations.get(template.getAnimation()).uid);
|
||||
this.sound = A.sounds.get(template.getSound()).uid;
|
||||
this.animation = new RandomAnimationsRunner(2).nRange(0, 2f).nScale(0.2f, 0.15f).uAnimationSpeed(0.5f, 1f).nRotation(0, 10).offset(0, -10).uDelay(250, 500).with(A.animations.byName(template.getAnimation()).$);
|
||||
this.sound = A.sounds.byName(template.getSound()).$;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,12 +52,12 @@ public class RangedWeapon extends BaseItem implements Weapon {
|
||||
this.dmgRoller = DiceRoller.of(template.getDamage());
|
||||
this.rangeRoller = DiceRoller.of(template.getRange());
|
||||
this.cooldown = template.getCooldown();
|
||||
this.animation = new BulletAnimationRunner(A.animations.get(template.getAnimation()).uid).infinite().offset(0, -15).onHit(this::onHit).onMiss(this::onMiss).speed(7f).animationSpeed(4f).scale(0.6f);
|
||||
this.sound = A.sounds.get(template.getSound()).uid;
|
||||
this.punchAnimation = new SimpleAnimationRunner(A.animations.get(template.getPunchAnimation()).uid);
|
||||
this.punchSound = A.sounds.get(template.getPunchSound()).uid;
|
||||
this.missAnimation = new SimpleAnimationRunner(A.animations.get(template.getMissAnimation()).uid).scale(0.4f);
|
||||
this.missSound = A.sounds.get(template.getMissSound()).uid;
|
||||
this.animation = new BulletAnimationRunner(A.animations.byName(template.getAnimation()).$).infinite().offset(0, -15).onHit(this::onHit).onMiss(this::onMiss).speed(7f).animationSpeed(4f).scale(0.6f);
|
||||
this.sound = A.sounds.byName(template.getSound()).$;
|
||||
this.punchAnimation = new SimpleAnimationRunner(A.animations.byName(template.getPunchAnimation()).$);
|
||||
this.punchSound = A.sounds.byName(template.getPunchSound()).$;
|
||||
this.missAnimation = new SimpleAnimationRunner(A.animations.byName(template.getMissAnimation()).$).scale(0.4f);
|
||||
this.missSound = A.sounds.byName(template.getMissSound()).$;
|
||||
}
|
||||
|
||||
private void onHit(Movable attacker, Entity target) {
|
||||
|
||||
@@ -57,12 +57,12 @@ public class ThrowingWeapon extends StackableItem implements Weapon {
|
||||
this.dmgRoller = DiceRoller.of(template.getDamage());
|
||||
this.rangeRoller = DiceRoller.of(template.getRange());
|
||||
this.cooldown = template.getCooldown();
|
||||
this.animation = new BulletAnimationRunner(A.animations.get(template.getAnimation()).uid).infinite().offset(0, -15).onHit(this::onHit).onMiss(this::onMiss).speed(7f).animationSpeed(4f).scale(0.6f);
|
||||
this.sound = A.sounds.get(template.getSound()).uid;
|
||||
this.punchAnimation = new SimpleAnimationRunner(A.animations.get(template.getPunchAnimation()).uid);
|
||||
this.punchSound = A.sounds.get(template.getPunchSound()).uid;
|
||||
this.missAnimation = new SimpleAnimationRunner(A.animations.get(template.getMissAnimation()).uid).scale(0.4f);
|
||||
this.missSound = A.sounds.get(template.getMissSound()).uid;
|
||||
this.animation = new BulletAnimationRunner(A.animations.byName(template.getAnimation()).$).infinite().offset(0, -15).onHit(this::onHit).onMiss(this::onMiss).speed(7f).animationSpeed(4f).scale(0.6f);
|
||||
this.sound = A.sounds.byName(template.getSound()).$;
|
||||
this.punchAnimation = new SimpleAnimationRunner(A.animations.byName(template.getPunchAnimation()).$);
|
||||
this.punchSound = A.sounds.byName(template.getPunchSound()).$;
|
||||
this.missAnimation = new SimpleAnimationRunner(A.animations.byName(template.getMissAnimation()).$).scale(0.4f);
|
||||
this.missSound = A.sounds.byName(template.getMissSound()).$;
|
||||
}
|
||||
|
||||
private void onHit(Movable attacker, Entity target) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<base:BorderLayout-BottomLeft>
|
||||
<base:Label
|
||||
ref="log"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="400f"
|
||||
height="25f"
|
||||
alignment="bottom|left"
|
||||
@@ -34,7 +34,7 @@
|
||||
<base:BorderLayout-BottomRight width="auto" height="auto">
|
||||
<base:TextView
|
||||
ref="debug"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
alignment="top|right"
|
||||
color="0xFFFFFF"
|
||||
fontSize="15f"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
margin="20f"
|
||||
width="900f"
|
||||
height="auto">
|
||||
<base:TextView ref="message" alignment="top|left" font="A.fonts.roboto_regular.uid" fontSize="40f" width="relative"
|
||||
<base:TextView ref="message" alignment="top|left" font="A.fonts.roboto_regular.$" fontSize="40f" width="relative"
|
||||
rows="4" color="0xFFFFFF"/>
|
||||
|
||||
</demo:DialogWindow>
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="use"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="drop"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="cancel"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<base:VLayout width="200f">
|
||||
|
||||
<base:Label
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|center"
|
||||
red="1f"
|
||||
@@ -23,7 +23,7 @@
|
||||
<base:VOptionChoice ref="menu" width="relative">
|
||||
<demo:Button
|
||||
ref="resume_game"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="equipment"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="start_menu"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="exit"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<base:VLayout width="200f">
|
||||
<base:Label
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|center"
|
||||
red="1f"
|
||||
@@ -22,7 +22,7 @@
|
||||
<base:VOptionChoice ref="menu" width="relative">
|
||||
<demo:Button
|
||||
ref="new_game"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<demo:Button
|
||||
ref="exit"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
red="1f"
|
||||
green="1f"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<base:VLayout width="auto" height="auto">
|
||||
<base:Label
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|left"
|
||||
red="1f"
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
<base:VLayout height="relative" padding="20f" width="250f">
|
||||
<base:Label ref="item-name"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|center"
|
||||
color="0xFFFFFF"
|
||||
@@ -77,7 +77,7 @@
|
||||
margin="5f"/>
|
||||
|
||||
<base:Label ref="item-details"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|left"
|
||||
color="0xFFFFFF"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<base:VLayout width="auto" height="auto">
|
||||
<base:Label
|
||||
ref="title"
|
||||
font="A.fonts.roboto_regular.uid"
|
||||
font="A.fonts.roboto_regular.$"
|
||||
width="relative"
|
||||
alignment="top|center"
|
||||
red="1f"
|
||||
|
||||
Reference in New Issue
Block a user