Pārlūkot izejas kodu

fishing fixes

tags/v0.1.5^2
Big Bad Waffle pirms 6 gadiem
vecāks
revīzija
6ef1a986ad
5 mainītis faili ar 30 papildinājumiem un 4 dzēšanām
  1. +4
    -2
      src/client/js/components/dialogue.js
  2. +3
    -0
      src/client/js/components/trade.js
  3. +11
    -2
      src/client/ui/templates/trade/trade.js
  4. +3
    -0
      src/server/components/trade.js
  5. +9
    -0
      src/server/config/maps/tutorial/events/fishingTournament.js

+ 4
- 2
src/client/js/components/dialogue.js Parādīt failu

@@ -1,9 +1,11 @@
define([
'js/system/client',
'js/system/events'
'js/system/events',
'ui/factory'
], function(
client,
events
events,
factory
) {
return {
type: 'dialogue',


+ 3
- 0
src/client/js/components/trade.js Parādīt failu

@@ -40,6 +40,9 @@ define([
delete blueprint.removeItems;
}

if (blueprint.redraw)
redraw = true;

for (var p in blueprint) {
this[p] = blueprint[p];
}


+ 11
- 2
src/client/ui/templates/trade/trade.js Parādīt failu

@@ -18,11 +18,20 @@ define([

modal: true,

list: null,
action: null,

postRender: function() {
this.onEvent('onGetTradeList', this.onGetTradeList.bind(this));
},

onGetTradeList: function(itemList, action) {
itemList = itemList || this.itemList;
action = action || this.action;

this.itemList = itemList;
this.action = action;

this.find('.heading-text').html(action);

var uiInventory = $('.uiInventory').data('ui');
@@ -113,7 +122,7 @@ define([
});
noAfford = ((!currencyItems) || (currencyItems.quantity < item.worth.amount));
} else
noAfford = (item.worth > window.player.trade.gold)
noAfford = (item.worth * this.itemList.markup > window.player.trade.gold)

if ((!noAfford) && (item.factions)) {
noAfford = item.factions.some(function(f) {
@@ -175,7 +184,7 @@ define([
});
canAfford = ((currencyItems) && (currencyItems.quantity >= item.worth.amount));
} else
canAfford = (item.worth <= window.player.trade.gold)
canAfford = (item.worth * this.itemList.markup <= window.player.trade.gold)
}

var uiTooltipItem = $('.uiTooltipItem').data('ui');


+ 3
- 0
src/server/components/trade.js Parādīt failu

@@ -222,6 +222,9 @@ define([
}, [this.obj.serverId]);
}

//Hack to always redraw the UI (to give items the red overlay if they can't be afforded)
this.obj.syncer.setArray(true, 'trade', 'redraw', true);

this.resolveCallback(msg);
},



+ 9
- 0
src/server/config/maps/tutorial/events/fishingTournament.js Parādīt failu

@@ -309,6 +309,15 @@ module.exports = {
stats: {
stats: '???'
}
}, {
name: 'Cerulean Pearl',
material: true,
sprite: [11, 9],
infinite: true,
worth: {
currency: `Angler's Mark`,
amount: 7
},
}],
level: {
min: 1,


Notiek ielāde…
Atcelt
Saglabāt