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

- Reldens - v4.0.0-beta.31 #232

Merged
merged 92 commits into from Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
4f7cf44
- Reldens - v4.0.0 - Bump version.
damian-pastorini Dec 22, 2023
84dfd83
- Reldens - v4.0.0 - Fixed migrations.
damian-pastorini Dec 22, 2023
02080ae
- Reldens - v4.0.0 - Users displayed data in admin fix.
damian-pastorini Dec 22, 2023
c401760
- Reldens - v4.0.0 - Improve maps log.
damian-pastorini Dec 27, 2023
890a0a3
- Reldens - v4.0.0 - Fixed avatar default position on class selector.
damian-pastorini Dec 27, 2023
adb8536
- Reldens - v4.0.0 - Changed Ads log level.
damian-pastorini Jan 3, 2024
1addc75
- Reldens - v4.0.0 - Included created animations validation.
damian-pastorini Jan 3, 2024
79c5caa
- Reldens - v4.0.0 - Player change scene log fix.
damian-pastorini Jan 3, 2024
ded8754
- Reldens - v4.0.0 - EnemyObject battle end callback log level fix.
damian-pastorini Jan 3, 2024
bb899e2
- Reldens - v4.0.0 - Missing space.
damian-pastorini Jan 7, 2024
ac6a258
- Reldens - v4.0.0 - Changed default trace logs level.
damian-pastorini Jan 7, 2024
b407eda
- Reldens - v4.0.0 - Client side bullets debug.
damian-pastorini Jan 7, 2024
d43c7a7
- Reldens - v4.0.0 - Changed default log level.
damian-pastorini Jan 7, 2024
389dbda
- Reldens - v4.0.0 - Objects events prefix.
damian-pastorini Jan 7, 2024
27c14e1
- Reldens - v4.0.0 - AnimationObject events prefix.
damian-pastorini Jan 7, 2024
6a4fd90
- Reldens - v4.0.0 - BaseObject events prefix and UID fix.
damian-pastorini Jan 7, 2024
b9a29fe
- Reldens - v4.0.0 - DropObject events prefix.
damian-pastorini Jan 7, 2024
8cfbf80
- Reldens - v4.0.0 - NpcObject events prefix.
damian-pastorini Jan 7, 2024
1e078df
- Reldens - v4.0.0 - TraderObject events prefix.
damian-pastorini Jan 7, 2024
d7b8b58
- Reldens - v4.0.0 - Missing property initializer.
damian-pastorini Jan 7, 2024
c88e2af
- Reldens - v4.0.0 - Bind event callback.
damian-pastorini Jan 7, 2024
9712fef
- Reldens - v4.0.0 - Include respawn object instance creation debug log.
damian-pastorini Jan 7, 2024
364ab9f
- Reldens - v4.0.0 - Moved constant value.
damian-pastorini Jan 7, 2024
74a2e9a
- Reldens - v4.0.0 - Included return value.
damian-pastorini Jan 7, 2024
274bc2c
- Reldens - v4.0.0 - Fixed comment.
damian-pastorini Jan 7, 2024
4616968
- Reldens - v4.0.0 - Fixed conditions.
damian-pastorini Jan 7, 2024
795091d
- Reldens - v4.0.0 - Fixed debug log.
damian-pastorini Jan 7, 2024
1b518c1
- Reldens - v4.0.0 - Fixed debug world creator.
damian-pastorini Jan 7, 2024
f0cf8fd
- Reldens - v4.0.0 - Save world timer for later clear. - Created worl…
damian-pastorini Jan 7, 2024
c11f08c
- Reldens - v4.0.0 - Disabled world plugin by default.
damian-pastorini Jan 7, 2024
3d783ac
- Reldens - v4.0.0 - Removed WorldTimer world reference.
damian-pastorini Jan 7, 2024
6a972f9
- Reldens - v4.0.0 - Fixed classes avatars animations.
damian-pastorini Jan 9, 2024
bb6de1a
- Reldens - v4.0.0 - Replaced anonymous functions by binded named fun…
damian-pastorini Jan 9, 2024
03085f7
- Reldens - v4.0.0 - Avatar debug log.
damian-pastorini Jan 9, 2024
d810728
- Reldens - v4.0.0 - BaseObject events prefix.
damian-pastorini Jan 9, 2024
179cc4c
- Reldens - v4.0.0 - Object validation on rewards subscriber.
damian-pastorini Jan 9, 2024
703d49b
- Reldens - v4.0.0 - Avoid animation creation duplicate. - Improved p…
damian-pastorini Jan 11, 2024
cfa6762
- Reldens - v4.0.0 - Improved actions receiver logs.
damian-pastorini Jan 11, 2024
019cdd2
- Reldens - v4.0.0 - Fixed actions events listener and improved logs.
damian-pastorini Jan 11, 2024
83676ba
- Reldens - v4.0.0 - Skills room reference note.
damian-pastorini Jan 11, 2024
62981f0
- Reldens - v4.0.0 - Improved PvE battle validation and logs.
damian-pastorini Jan 11, 2024
47d5969
- Reldens - v4.0.0 - Implemented player unique event key.
damian-pastorini Jan 11, 2024
aa9f681
- Reldens - v4.0.0 - Fixed objects event prefix.
damian-pastorini Jan 11, 2024
c10ef64
- Reldens - v4.0.0 - Include room data in ObjectsManager.
damian-pastorini Jan 11, 2024
292a252
- Reldens - v4.0.0 - Implemented objects unique event key.
damian-pastorini Jan 11, 2024
d8a6ef1
- Reldens - v4.0.0 - Implemented animation objects unique event key.
damian-pastorini Jan 11, 2024
6610de4
- Reldens - v4.0.0 - Changed themes default log level.
damian-pastorini Jan 11, 2024
cdc0ba9
- Reldens - v4.0.0 - Update packages.
damian-pastorini Jan 11, 2024
dffd8ab
- Reldens - v4.0.0 - Fixed chat NPC and Player skills event listeners.
damian-pastorini Jan 11, 2024
5d65baf
- Reldens - v4.0.0 - Fixed scene logs.
damian-pastorini Jan 11, 2024
aca89e2
- Reldens - v4.0.0 - Fixed drop object event prefix.
damian-pastorini Jan 12, 2024
54b9b7c
- Reldens - v4.0.0 - Fixed NPC object event prefix.
damian-pastorini Jan 12, 2024
d90cf0a
- Reldens - v4.0.0 - Fixed trader object event prefix.
damian-pastorini Jan 12, 2024
dc4c7aa
- Reldens - v4.0.0 - Improved respawn server plugin logs.
damian-pastorini Jan 12, 2024
4c5fa0d
- Reldens - v4.0.0 - Fixed rewards subscriber validation.
damian-pastorini Jan 12, 2024
b39088f
- Reldens - v4.0.0 - Fixed rewards server plugin events.
damian-pastorini Jan 12, 2024
3ff6aef
- Reldens - v4.0.0 - World drop TODO.
damian-pastorini Jan 12, 2024
8cc23e2
- Reldens - v4.0.0 - Inventory client plugin listen events keys fix.
damian-pastorini Jan 14, 2024
f2c1cd5
- Reldens - v4.0.0 - Included objects events suffix.
damian-pastorini Jan 14, 2024
c668e46
- Reldens - v4.0.0 - Fixed enemy-object events for battle.
damian-pastorini Jan 14, 2024
ede8e09
- Reldens - v4.0.0 - Removed TODO.
damian-pastorini Jan 14, 2024
43ccde7
- Reldens - v4.0.0 - Implemented onRoomDispose event emit.
damian-pastorini Jan 14, 2024
2c59c76
- Reldens - v4.0.0 - Implemented rooms created instance clean up.
damian-pastorini Jan 14, 2024
8829329
- Reldens - v4.0.0 - Scene fixed world timer, clean up player referen…
damian-pastorini Jan 14, 2024
ff142ad
- Reldens - v4.0.0 - Fixed Users Server Plugin events listeners.
damian-pastorini Jan 14, 2024
a548d79
- Reldens - v4.0.0 - Updated reldens items package.
damian-pastorini Jan 14, 2024
ee818a3
- Reldens - v4.0.0 - Battle inState validations fixed and improved logs.
damian-pastorini Jan 15, 2024
d3289d5
- Reldens - v4.0.0 - Login room method bind.
damian-pastorini Jan 15, 2024
e2f598f
- Reldens - v4.0.0 - PvE fixed inState status.
damian-pastorini Jan 15, 2024
49558d9
- Reldens - v4.0.0 - RoomScene improved logs.
damian-pastorini Jan 15, 2024
cf394ab
- Reldens - v4.0.0 - Include Body methods on State.
damian-pastorini Jan 15, 2024
f044e9b
- Reldens - v4.0.0 - Implemented new State methods on P2World.
damian-pastorini Jan 15, 2024
e06ae2a
- Reldens - v4.0.0 - Implemented new State methods on Collisions Mana…
damian-pastorini Jan 15, 2024
f9f9aa2
- Reldens - v4.0.0 - EnemyObject fixed inState and improved logs.
damian-pastorini Jan 15, 2024
9b3cd09
- Reldens - v4.0.0 - Room respawn improve logs.
damian-pastorini Jan 15, 2024
2b0bb20
- Reldens - v4.0.0 - BaseObject fixed appednIndex.
damian-pastorini Jan 15, 2024
c1c8c84
- Reldens - v4.0.0 - Saved auto destroy drop timer on handler.
damian-pastorini Jan 15, 2024
9c51be0
- Reldens - v4.0.0 - Implemented state bodies methods on skills.
damian-pastorini Jan 15, 2024
aa2a1b4
- Reldens - v4.0.0 - Fixed chat messages data.
damian-pastorini Jan 15, 2024
bcb69fc
- Reldens - v4.0.0 - Implement state bodies methods on respawn.
damian-pastorini Jan 15, 2024
293e243
- Reldens - v4.0.0 - Fixed objects respawn timers clear. - Included s…
damian-pastorini Jan 16, 2024
4492fe8
- Reldens - v4.0.0 - Fixed clear interval.
damian-pastorini Jan 16, 2024
f7656d5
- Reldens - v4.0.0 - Fixed missing file names on default theme.
damian-pastorini Jan 17, 2024
0eab458
- Reldens - v4.0.0 - Updated items animation data.
damian-pastorini Jan 17, 2024
28a1599
- Reldens - v4.0.0 - Fixed items sprites animations play. - Fixed spr…
damian-pastorini Jan 17, 2024
15d158f
- Reldens - v4.0.0 - Default theme improvements.
damian-pastorini Jan 17, 2024
060342c
- Reldens - v4.0.0 - Fixed gravity world overspeed.
damian-pastorini Jan 17, 2024
b049f2b
- Reldens - v4.0.0 - Fixed Image tile area not tile size multiple in:…
damian-pastorini Jan 18, 2024
1ec704c
- Reldens - v4.0.0 - Improved playerDeathTimer.
damian-pastorini Jan 18, 2024
2a03110
- Reldens - v4.0.0 - Fixed player references removal.
damian-pastorini Jan 19, 2024
1885f46
- Reldens - v4.0.0 - Fixed change point in sample data. - Included ch…
damian-pastorini Jan 19, 2024
46a33f2
- Reldens - v4.0.0 - Updated caniuse-lite.
damian-pastorini Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Expand Up @@ -14,6 +14,10 @@ While the current stage of the platform is tailored for developers, ongoing impr

---

## [Check our website for the latest news!](https://www.reldens.com/ "Check our website for the latest news")

---

## [Features Overview](https://www.reldens.com/features)
[First to mention, if the feature you need is not available, you can request a feature here: https://www.reldens.com/features-request](https://www.reldens.com/features-request)

Expand Down Expand Up @@ -43,11 +47,9 @@ As for the latest version released the platform will provide you with the follow

---

## [Check our website for the latest news!](https://www.reldens.com/ "Check our website for the latest news")

---
## [Installation](https://www.reldens.com/documentation/installation "Installation")

## [Installation Guide](https://www.reldens.com/installation "Installation Guide")
Please follow the Installation Guide: https://www.reldens.com/documentation/installation.

---

Expand Down
4 changes: 3 additions & 1 deletion lib/actions/client/player-selector.js
Expand Up @@ -92,7 +92,9 @@ class PlayerSelector
let avatarKey = select.options[select.selectedIndex].dataset.key;
avatar.classList.add('class-path-select-avatar');
avatar.style.backgroundImage = `url('/assets/custom/sprites/${avatarKey}${GameConst.FILES.EXTENSIONS.PNG}')`;
avatar.style.width = playersConfig.size.width+'px';
let widthInPx = playersConfig.size.width+'px';
avatar.style.backgroundPositionX = '-'+widthInPx;
avatar.style.width = widthInPx;
avatar.style.height = playersConfig.size.height+'px';
select.addEventListener('change', () => {
let avatarKey = select.options[select.selectedIndex].dataset.key;
Expand Down
80 changes: 26 additions & 54 deletions lib/actions/client/preloader-handler.js
Expand Up @@ -2,48 +2,6 @@
*
* Reldens - PreloaderHandler.
*
* Main functionalities:
* The PreloaderHandler class is responsible for handling the preloading and creation of animations and assets used in
* the game. It loads HTML templates, spritesheets, and creates animations based on the configuration data provided by
* the game manager. It also handles the preparation and creation of animations with multiple directions and the
* creation of avatars animations.
*
* Methods:
* - constructor(props): initializes the class with the game manager and events manager objects, and sets the
* properties.
* - setProperties(props): sets the properties of the class, such as the game DOM, initial game data, and animations
* configuration.
* - loadContents(uiScene): loads HTML templates and preloads animations based on the configuration data.
* - preloadClassPaths(uiScene): preloads spritesheets for class paths based on the initial game data.
* - createAnimations(preloadScene): creates animations based on the configuration data.
* - createAvatarsAnimations(preloadScene): creates animations for avatars based on the initial game data.
* - loopAnimationsAnd(animations, command, uiScene): loops through the animations and executes the specified command
* (preload or create) for each animation.
* - preloadAnimation(data, uiScene): preloads animations based on the configuration data, including animations with
* multiple directions.
* - preloadAnimationsInDirections(data, uiScene): preloads animations in different directions based on the
* configuration data.
* - preloadSpriteInDirection(uiScene, data, direction): preloads a sprite in a specific direction based on the
* configuration data.
* - createAnimation(data, uiScene): creates animations based on the configuration data, including animations with
* multiple directions.
* - createWithMultipleDirections(uiScene, data, animDir): creates animations with multiple directions based on the
* configuration data.
* - createWithDirection(data, uiScene, direction = false): creates animations in a specific direction based on the
* configuration data.
* - prepareAnimationData(data, uiScene, direction = false): prepares the animation data based on the configuration
* data and direction.
* - getAnimationKey(data, direction = false): gets the animation key based on the configuration data and direction.
*
* Fields:
* - gameManager: the game manager object.
* - events: the events manager object.
* - gameDom: the game DOM object.
* - initialGameData: the initial game data object.
* - levelsAnimConfig: the levels animations configuration object.
* - skillsAnimConfig: the skills animations configuration object.
* - assetsCustomActionsSpritesPath: the path to the custom actions sprites assets.
*
*/

const { Logger, sc } = require('@reldens/utils');
Expand Down Expand Up @@ -79,7 +37,12 @@ class PreloaderHandler
'assetsCustomActionsSpritesPath',
'assets/custom/actions/sprites/'
);
this.gameManager.loadedAssets = {};
if(!this.gameManager.loadedAssets){
this.gameManager.loadedAssets = {};
}
if(!this.gameManager.createdAnimations){
this.gameManager.createdAnimations = {};
}
}

loadContents(uiScene)
Expand Down Expand Up @@ -127,34 +90,38 @@ class PreloaderHandler
{
let classesData = sc.get(this.initialGameData, 'classesData', false);
if(!classesData){
Logger.debug('Classes data not found. Fallback to player avatar.');
return false;
}
if(!this.gameManager.mappedAvatars){
this.gameManager.mappedAvatars = {};
}
Logger.debug({availableClassesData: classesData});
for(let i of Object.keys(classesData)){
let avatarKey = classesData[i].key;
if(!this.gameManager.loadedAssets[avatarKey]){
avatarKey = GameConst.IMAGE_PLAYER;
Logger.info('Avatar for class path "'+avatarKey+'" not found in assets. Fallback to player avatar.');
this.gameManager.mappedAvatars[avatarKey] = GameConst.IMAGE_PLAYER;
continue;
}
this.gameManager.mappedAvatars[avatarKey] = avatarKey;
return preloadScene.createPlayerAnimations(avatarKey);
preloadScene.createPlayerAnimations(avatarKey);
}
return this.gameManager.mappedAvatars;
}

loopAnimationsAnd(animations, command, uiScene)
{
if(!animations){
Logger.warning('Animations not found.', animations);
return false;
}
for(let i of Object.keys(animations)){
let data = animations[i];
if(!data.animationData.enabled){
Logger.debug('Animation "'+i+'" not enabled, skipping.', data);
continue;
}
// preloadAnimation or createAnimation
Logger.debug({[command+'Animation']: data});
this[command+'Animation'](data, uiScene);
}
}
Expand Down Expand Up @@ -242,19 +209,24 @@ class PreloaderHandler
}
}

createWithDirection(data, uiScene, direction = false)
createWithDirection(data, uiScene, direction = '')
{
let animationCreateData = this.prepareAnimationData(data, uiScene, direction);
let animation = uiScene.anims.create(animationCreateData);
if(this.gameManager.createdAnimations[animationCreateData.key]){
return this.gameManager.createdAnimations[animationCreateData.key];
}
let newAnimation = uiScene.anims.create(animationCreateData);
if(sc.hasOwn(data.animationData, 'destroyTime')){
animation.destroyTime = data.animationData.destroyTime;
newAnimation.destroyTime = data.animationData.destroyTime;
}
if(sc.hasOwn(data.animationData, 'depthByPlayer')){
animation.depthByPlayer = data.animationData.depthByPlayer;
newAnimation.depthByPlayer = data.animationData.depthByPlayer;
}
this.gameManager.createdAnimations[animationCreateData.key] = newAnimation;
return this.gameManager.createdAnimations[animationCreateData.key];
}

prepareAnimationData(data, uiScene, direction = false)
prepareAnimationData(data, uiScene, direction = '')
{
// @NOTE: here we use have two keys, the animation key and the animationData.img, this is because we could have
// a single sprite with multiple attacks, and use the start and end frame to run the required one.
Expand All @@ -275,9 +247,9 @@ class PreloaderHandler
return animationCreateData;
}

getAnimationKey(data, direction = false)
getAnimationKey(data, direction = '')
{
return (data.skillKey ? data.skillKey+'_' : '')+data.key+(direction ? '_'+direction : '');
return (data.skillKey ? data.skillKey+'_' : '')+data.key+(direction && '' !== direction ? '_'+direction : '');
}

}
Expand Down
9 changes: 5 additions & 4 deletions lib/actions/client/receiver-wrapper.js
Expand Up @@ -156,9 +156,7 @@ class ReceiverWrapper extends Receiver
targetSprite.moveSprites[hitAnimKey + '_' + targetSpriteId] = hitSprite;
}
let animData = allAnimations[hitAnimKey];
let depth = 'above' === sc.get(animData.animationData, 'depthByPlayer', '')
? targetSprite.depth + 100
: targetSprite.depth - 0.1;
let depth = targetSprite.depth+('above' === sc.get(animData.animationData, 'depthByPlayer', '') ? 100 : -0.1);
hitSprite.depthByPlayer = animData.animationData.depthByPlayer;
hitSprite.setDepth(depth);
return hitSprite;
Expand Down Expand Up @@ -270,7 +268,10 @@ class ReceiverWrapper extends Receiver
let sceneAnimation = currentScene.getAnimationByKey(animationKey);
if(!sceneAnimation){
if(-1 === animationKey.indexOf('default')){
Logger.error('Animation sprite not found', animationKey);
Logger.error(
'Animation sprite not found for "'+animationKey+'".',
this.gameManager.config.client.skills.animations
);
}
return false;
}
Expand Down
37 changes: 25 additions & 12 deletions lib/actions/server/battle.js
Expand Up @@ -32,17 +32,20 @@ class Battle
async runBattle(playerSchema, target)
{
if(GameConst.STATUS.ACTIVE !== playerSchema.inState){
Logger.info('Battle inactive player.', playerSchema.inState);
Logger.error('Battle inactive player with ID "'+playerSchema.player_id+'".', playerSchema.inState);
return false;
}
if(target.inState && GameConst.STATUS.ACTIVE !== target.inState){
Logger.info('Battle inactive target.', target.inState);
if(target.inState && GameConst.STATUS.ACTIVE.toString() !== target.inState.toString()){
Logger.error(
'Inactive target ID "'+(target.uid || target.player_id)
+'" in state "'+target.inState+'"/"'+GameConst.STATUS.ACTIVE+'".'
);
return false;
}
// @NOTE: each attack will have different properties to validate like range, delay, etc.
let currentAction = this.getCurrentAction(playerSchema);
if(!currentAction){
Logger.error(['Actions not defined for this player.', 'ID:', playerSchema.player_id]);
Logger.error('Actions not defined for this player with ID "'+playerSchema.player_id+'".');
return false;
}
currentAction.currentBattle = this;
Expand Down Expand Up @@ -92,6 +95,10 @@ class Battle

async clientDeathUpdate(targetSchema, room, targetClient, affectedProperty)
{
if(!targetSchema.player_id){
Logger.error('Target is not a player.', targetSchema.player_id);
return false;
}
targetSchema.inState = GameConst.STATUS.DEATH;
let actionData = new BattleEndAction(
targetSchema.state.x,
Expand All @@ -105,14 +112,20 @@ class Battle
await room.savePlayerState(targetSchema.sessionId);
targetClient.send('*', {act: GameConst.GAME_OVER});
await room.savePlayerStats(targetSchema, targetClient);
setTimeout(async () => {
room.roomWorld.addBody(body);
targetSchema.inState = GameConst.STATUS.ACTIVE;
// player is dead! reinitialize the stats using its base value:
targetSchema.stats[affectedProperty] = targetSchema.statsBase[affectedProperty];
await room.savePlayerStats(targetSchema, targetClient);
room.broadcast('*', {act: GameConst.REVIVED, t: targetSchema.sessionId});
}, (room.config.get('server/players/gameOver/timeOut') || 1));
targetSchema.setPrivate(
'playerDeathTimer',
setTimeout(
async () => {
room.roomWorld.addBody(body);
targetSchema.inState = GameConst.STATUS.ACTIVE;
// player is dead! reinitialize the stats using its base value:
targetSchema.stats[affectedProperty] = targetSchema.statsBase[affectedProperty];
await room.savePlayerStats(targetSchema, targetClient);
room.broadcast('*', {act: GameConst.REVIVED, t: targetSchema.sessionId});
},
(room.config.get('server/players/gameOver/timeOut') || 1)
)
);
return false;
}
}
Expand Down
10 changes: 7 additions & 3 deletions lib/actions/server/event-listeners.js
Expand Up @@ -5,14 +5,18 @@
*/

const { SkillsEvents } = require('@reldens/skills');
const { sc } = require('@reldens/utils');
const { Logger, sc } = require('@reldens/utils');

class EventListeners
{

static async attachCastMovementEvents(props)
{
let {classPath, events, actionsPlugin} = props;
if(!classPath || !events || !actionsPlugin){
Logger.critical('EventListeners: classPath, events or actionsPlugin undefined.', props);
return;
}
let ownerId = classPath.getOwnerEventKey();
classPath.listenEvent(
SkillsEvents.SKILL_BEFORE_CAST,
Expand All @@ -22,7 +26,7 @@ class EventListeners
}
skill.owner.physicalBody.isBlocked = true;
},
'skillBeforeCastPack',
classPath.getOwnerUniqueEventKey('skillBeforeCastPack'),
ownerId
);
classPath.listenEvent(
Expand All @@ -33,7 +37,7 @@ class EventListeners
}
skill.owner.physicalBody.isBlocked = false;
},
'skillAfterCastPack',
classPath.getOwnerUniqueEventKey('skillAfterCastPack'),
ownerId
);
await events.emit('reldens.actionsPrepareEventsListeners', actionsPlugin, classPath);
Expand Down
9 changes: 6 additions & 3 deletions lib/actions/server/player-enricher.js
Expand Up @@ -45,10 +45,13 @@ class PlayerEnricher
currentPlayer.getSkillExtraData = (params) => {
return SkillsExtraData.extractSkillExtraData(params);
};
currentPlayer.executePhysicalSkill = this.playerExecutePhysicalSkillCallback(currentPlayer, room);
currentPlayer.executePhysicalSkill = this.playerExecutePhysicalSkillCallback(
currentPlayer,
room.config.client.skills.animations
);
}

static playerExecutePhysicalSkillCallback(currentPlayer, room)
static playerExecutePhysicalSkillCallback(currentPlayer, skillsAnimationsData)
{
return async (target, executedSkill) => {
let messageData = Object.assign({skillKey: executedSkill.key}, executedSkill.owner.getPosition());
Expand All @@ -64,7 +67,7 @@ class PlayerEnricher
);
let from = {x: currentPlayer.state.x, y: currentPlayer.state.y};
executedSkill.initialPosition = from;
let animData = sc.get(room.config.client.skills.animations, executedSkill.key + '_bullet', false);
let animData = sc.get(skillsAnimationsData, executedSkill.key + '_bullet', false);
if(animData){
executedSkill.animDir = sc.get(animData.animationData, 'dir', false);
}
Expand Down