Browse Source

Fixes #16

tags/v0.1.2
Big Bad Waffle 7 years ago
parent
commit
71636b9574
4 changed files with 16 additions and 6 deletions
  1. +1
    -1
      src/client/js/components/trade.js
  2. +11
    -3
      src/client/ui/templates/equipment/equipment.js
  3. +1
    -1
      src/server/components/player.js
  4. +3
    -1
      src/server/components/trade.js

+ 1
- 1
src/client/js/components/trade.js View File

@@ -10,7 +10,7 @@ define([
action: 'buy',

init: function(blueprint) {
},

extend: function(blueprint) {


+ 11
- 3
src/client/ui/templates/equipment/equipment.js View File

@@ -81,6 +81,9 @@ define([
items = items || this.items;
this.items = items;

if (!this.shown)
return;

this.find('.slot').addClass('empty');

var skipSpellId = 0;
@@ -248,8 +251,13 @@ define([
},

onGetStats: function(stats) {
stats = stats || this.stats;
this.stats = stats;
if (stats)
this.stats = stats;

stats = this.stats;

if (!this.shown)
return;

var container = this.el.find('.stats');

@@ -264,7 +272,7 @@ define([
level: stats.level,
'next level': xpRemaining + 'xp',
gap1: '',
gold: 0, //window.player.trade.gold,
gold: window.player.trade.gold,
gap2: '',
hp: ~~stats.hp + '/' + stats.hpMax,
mana: ~~stats.mana + '/' + stats.manaMax,


+ 1
- 1
src/server/components/player.js View File

@@ -63,7 +63,7 @@ define([
obj.addComponent('spellbook');

obj.addComponent('dialogue');
obj.addComponent('trade');
obj.addComponent('trade', character.components.find(c => c.type == 'trade'));
obj.addComponent('reputation', character.components.find(c => c.type == 'reputation'));

obj.addComponent('social');


+ 3
- 1
src/server/components/trade.js View File

@@ -11,7 +11,7 @@ define([

maxBuyback: 10,

gold: 1000,
gold: 0,

target: null,

@@ -21,6 +21,8 @@ define([
},

init: function(blueprint) {
this.gold = blueprint.gold;

if (!blueprint.items)
return;



Loading…
Cancel
Save