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

WIP: Desarrollo v0.1.15 #381

Closed
wants to merge 60 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
703c0f0
Arreglos a WidgetFactory
cpbeto Dec 3, 2020
d18e942
Pide confirmación para cerrar el juego con ESC
cpbeto Dec 3, 2020
05fcd85
Agrega botones para agregar y eliminar servidores de la lista
cpbeto Dec 3, 2020
37adcb2
Normaliza sintaxis en SoundsSystem
cpbeto Dec 6, 2020
24a8f2a
Crea Slider en LoginScreen para controlar el volumen de la música
cpbeto Dec 6, 2020
a0fa99f
Implementa volumen global para el sistema de sonido
cpbeto Dec 7, 2020
82d2b43
Mantiene una instancia única y global de MusicSystem
cpbeto Dec 7, 2020
e3ab497
Fix: Música se reinicia al volver a la pantalla de login
cpbeto Dec 7, 2020
4a9df6a
Arreglos a MusicSystem
cpbeto Dec 7, 2020
f5d07f7
Crea aplicación de testing para hacer pruebas de interfaz gráfica
cpbeto Dec 11, 2020
48ce23f
Usa switch expressions de Java 8
cpbeto Apr 14, 2022
484469e
Merge branch 'master' into develop
cpbeto Apr 14, 2022
a96c6e1
chore(): merge branches `develop` and `overwhelmed`
joaquinodz Apr 15, 2022
53884af
login screen small bug fix and cosmetic
bestiardo Apr 16, 2022
035d265
generic scrollpane creator
bestiardo Apr 16, 2022
5a61338
Merge pull request #380 from bestiardo/develop+overwhelmedFix
joaquinodz Apr 16, 2022
8bd5a06
Add Server Button update
bestiardo Apr 16, 2022
e3b4216
Remueve artemis-fluid de ServerSystem
cpbeto Apr 17, 2022
d405233
Remueve artemis-fluid de UserSystem
cpbeto Apr 17, 2022
41ba070
Remueve artemis-fluid de ServerNotificationProcessor
cpbeto Apr 17, 2022
2cc9986
Deshabilita proyecto design para evitar errores de CI
cpbeto Apr 17, 2022
3128bc8
imagen faltante para animacion de fantasma
bestiardo Apr 17, 2022
632c74d
Merge pull request #385 from bestiardo/d+o_add_server_button_update
cpbeto Apr 17, 2022
7da169e
Refactor CommandSystem
cpbeto Apr 17, 2022
74b3dee
Arreglar proyecto design #388 - Vuelve a compilar
bestiardo Apr 17, 2022
47e4350
Merge pull request #390 from bestiardo/desarrollo-v0.1.15-desing
joaquinodz Apr 17, 2022
1d1ca0f
Merge branch 'master' into desarrollo-v0.1.15
joaquinodz Apr 17, 2022
e45164f
Revert path changes
matisandacz Apr 18, 2022
8dd0636
Merge pull request #392 from matisandacz/desarrollo-v0.1.15
cpbeto Apr 18, 2022
fb3b716
Update AOConsole.java
bestiardo Apr 18, 2022
b8572b2
Update UserInterfaceSystem.java
bestiardo Apr 18, 2022
cae4d6d
Merge pull request #396 from bestiardo/desarrollo-v0.1.15-consoleupdate
cpbeto Apr 18, 2022
baa2ac2
Comando /help #389
bestiardo Apr 20, 2022
e04e66c
Update CommandSystem.java
bestiardo Apr 20, 2022
dc72002
Merge pull request #398 from bestiardo/comando-help
cpbeto Apr 20, 2022
e471fe6
Remueve artemis-fluid de PlayerActionSystem
cpbeto Apr 20, 2022
7debd55
Desacoplar el connectionId por fuera del modulo Network
matisandacz Apr 21, 2022
df4434c
Desacoplar connectionId de Drop Item
matisandacz Apr 21, 2022
e435f3e
merge with branch desarrollo-v0.1.15
matisandacz Apr 21, 2022
df2c38d
Merge pull request #401 from matisandacz/F400
cpbeto Apr 21, 2022
fc969f6
Remueve artemis-fluid de NetworkDictionary
cpbeto Apr 21, 2022
a775b66
Remueve artemis-fluid de WorldSaveSystem
cpbeto Apr 21, 2022
095ec97
Remueve artemis-fluid de ItemActionSystem
cpbeto Apr 21, 2022
54f4071
Remueve artemis-fluid de MovementSystem
cpbeto Apr 21, 2022
224931a
Remueve clase no usada TagManager
cpbeto Apr 21, 2022
e9a371e
Remueve todo en PlayerActionSystem
cpbeto Apr 21, 2022
a9a1c23
Remueve anotación @Wire de ComponentSystem
cpbeto Apr 21, 2022
c7ba897
Refactor EntityFactorySystem
cpbeto Apr 21, 2022
59103db
Deshabilita ProfilerSystem para no floodear el stdout
cpbeto Apr 21, 2022
f5ab5c5
F4 toggle roof
bestiardo Apr 23, 2022
6d9ea9e
Se agrega TP al clickear shift + click izquierdo con animacion
matisandacz Apr 23, 2022
005f12f
refactor FX number
matisandacz Apr 23, 2022
02d11e2
remove duplicated code and refactor
matisandacz Apr 23, 2022
e154058
#408 Limpiar el repositorio - removido carpeta graficosx2
bestiardo Apr 23, 2022
bd9bd4d
Merge pull request #411 from bestiardo/eliminar-graficosx2
joaquinodz Apr 23, 2022
0180193
Merge pull request #409 from bestiardo/map-layer-roof
joaquinodz Apr 23, 2022
30d4cb4
Revierte cambios a ProfilerSystem
cpbeto Apr 24, 2022
7e6e9db
Merge pull request #410 from matisandacz/F401
cpbeto Apr 24, 2022
e4f1e3a
Como iniciar el proyecto
Lorwik Apr 27, 2022
b37b589
Merge pull request #412 from Lorwik/desarrollo-v0.1.15
cpbeto Apr 28, 2022
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
53 changes: 35 additions & 18 deletions server/src/server/systems/world/entity/user/PlayerActionSystem.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package server.systems.world.entity.user;

import com.artemis.ComponentMapper;
import com.artemis.E;
import com.artemis.annotations.Wire;
import component.console.ConsoleMessage;
import component.entity.character.info.Bag;
import component.entity.world.Dialog;
import component.entity.world.Object;
import component.physics.AttackInterval;
import component.position.WorldPos;
import net.mostlyoriginal.api.system.core.PassiveSystem;
import server.systems.config.ObjectSystem;
Expand All @@ -28,7 +31,8 @@

import java.util.Optional;

@Wire
// @todo: connectionId debería estar encapsulado dentro de la parte de Network.
// Trabajar con playerId.
cpbeto marked this conversation as resolved.
Show resolved Hide resolved
public class PlayerActionSystem extends PassiveSystem {

// Injected systems.
Expand All @@ -43,13 +47,17 @@ public class PlayerActionSystem extends PassiveSystem {
private CommandSystem commandSystem;
private EntityUpdateSystem entityUpdateSystem;

ComponentMapper<AttackInterval> mAttackInterval;
ComponentMapper<Bag> mBag;
ComponentMapper<Object> mObject;
ComponentMapper<WorldPos> mWorldPos;

public void drop(int connectionId, int count, WorldPos position, int slot) {
int playerId = serverSystem.getPlayerByConnection(connectionId);
E entity = E.E(playerId);

// Remove item from inventory
InventoryUpdate update = new InventoryUpdate();
Bag bag = entity.getBag();
Bag bag = mBag.get(playerId);
Bag.Item item = bag.items[slot];
if (item == null) return;
if (item.equipped) {
Expand All @@ -63,30 +71,35 @@ public void drop(int connectionId, int count, WorldPos position, int slot) {
bag.remove(slot);
}
update.add(slot, bag.items[slot]); // should remove item if count <= 0
serverSystem.sendTo(serverSystem.getConnectionByPlayer(playerId), update);
serverSystem.sendTo(connectionId, update);

// Add new obj component.entity to world
int object = world.create();
E.E(object).worldPos()
.worldPosMap(position.map)
.worldPosX(position.x)
.worldPosY(position.y);
E.E(object).objectIndex(item.objId);
E.E(object).objectCount(count);
worldEntitiesSystem.registerEntity(object);
int objectId = world.create();

WorldPos worldPos = mWorldPos.create(objectId);
worldPos.map = position.map;
worldPos.x = position.x;
worldPos.y = position.y;

Object object = mObject.create(objectId);
object.index = item.objId;
object.count = count;

worldEntitiesSystem.registerEntity(objectId);
}

public void attack(int connectionId, long timestamp, WorldPos worldPos, AttackType type) {
int playerId = serverSystem.getPlayerByConnection(connectionId);
E entity = E.E(playerId);
if (!entity.hasAttackInterval()) {

if (!mAttackInterval.has(playerId)) {
if (type.equals(AttackType.RANGED)) {
rangedCombatSystem.shoot(playerId, worldPos, timestamp);
} else {
// todo use timestamp
physicalCombatSystem.entityAttack(playerId, Optional.empty());
}
entity.attackIntervalValue(Intervals.ATTACK_INTERVAL);
AttackInterval attackInterval = mAttackInterval.create(playerId);
attackInterval.setValue(Intervals.ATTACK_INTERVAL);
} else {
messageSystem.add(playerId,
ConsoleMessage.error((type.equals(AttackType.RANGED) ?
Expand All @@ -97,6 +110,9 @@ public void attack(int connectionId, long timestamp, WorldPos worldPos, AttackTy
}

public void talk(int playerID, String message) {
// Limpiamos mínimamente el mensaje.
message = message.strip();

// Si es un comando...
if (CommandSystem.isCommand(message)) {
if (commandSystem.commandExists(message)) {
Expand All @@ -113,10 +129,11 @@ public void talk(int playerID, String message) {

public void spell(int connectionId, Spell spell, WorldPos worldPos, long timestamp) {
int playerId = serverSystem.getPlayerByConnection(connectionId);
E entity = E.E(playerId);
if (!entity.hasAttackInterval()) {

if (!mAttackInterval.has(playerId)) {
magicCombatSystem.spell(playerId, spell, worldPos, timestamp);
entity.attackIntervalValue(Intervals.MAGIC_ATTACK_INTERVAL);
AttackInterval attackInterval = mAttackInterval.create(playerId);
attackInterval.setValue(Intervals.MAGIC_ATTACK_INTERVAL);
} else {
messageSystem.add(playerId,
ConsoleMessage.error(Messages.CANT_MAGIC_THAT_FAST.name()));
Expand Down