1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-23 19:36:53 +00:00
This commit is contained in:
exane 2015-06-22 20:19:06 +02:00
parent 513efc2116
commit 127fd69a87
6 changed files with 44 additions and 28 deletions

View File

@ -231,30 +231,25 @@ module.exports = {
}, },
"foltest_leader3": { "foltest_leader3": {
onActivate: function(){ onActivate: function(){
var field = this.field[2];
//todo: unless there is commanders horn active
/*siegeCards.forEach(function(card){
card.setBoost("foltest_leader3", card.getPower());
})*/
/*field.add(Card("commanders_horn", true));*/
/*this.placeCard("commanders_horn", {
forceField: field
});*/
this.setHorn("commanders_horn", 2); this.setHorn("commanders_horn", 2);
} }
}, },
"foltest_leader4": { "foltest_leader4": {
onActivate: function(){ onActivate: function(){
//scorch siege
} }
}, },
"francesca_leader1": { "francesca_leader1": {
onActivate: function(){ onActivate: function(){
var cards = this.deck.find("key", "biting_frost")
if(!cards.length) return;
var card = this.deck.removeFromDeck(cards[0]);
this.placeCard(card);
} }
}, },
"francesca_leader2": { "francesca_leader2": {
onActivate: function(){ onActivate: function(){
this.setHorn("commanders_horn", 1);
} }
}, },
"francesca_leader3": { "francesca_leader3": {
@ -275,10 +270,12 @@ module.exports = {
}, },
"eredin_leader3": { "eredin_leader3": {
onActivate: function(){ onActivate: function(){
} }
}, },
"eredin_leader4": { "eredin_leader4": {
onActivate: function(){ onActivate: function(){
this.setHorn("commanders_horn", 0);
} }
}, },
"hero": {} "hero": {}

View File

@ -35,7 +35,7 @@ module.exports = {
], ],
"scoiatael": [ "scoiatael": [
"francesca_daisy_of_the_valley", "francesca_the_beautiful",
"commanders_horn", "commanders_horn",
"commanders_horn", "commanders_horn",
"saesenthessis", "saesenthessis",
@ -44,6 +44,9 @@ module.exports = {
"eithne", "eithne",
"havekar_healer", "havekar_healer",
"riordain", "riordain",
"havekar_smuggler",
"havekar_smuggler",
"havekar_smuggler",
"toruviel", "toruviel",
"decoy", "decoy",
"decoy", "decoy",
@ -93,10 +96,7 @@ module.exports = {
"impenetrable_fog", "impenetrable_fog",
"endrega", "endrega",
"vampire_bruxa", "vampire_bruxa",
"vampire_bruxa",
"vampire_fleder", "vampire_fleder",
"vampire_fleder",
"vampire_garkain",
"vampire_garkain", "vampire_garkain",
"vampire_ekimmara", "vampire_ekimmara",
"commanders_horn", "commanders_horn",
@ -114,9 +114,6 @@ module.exports = {
//"vampire_katakan", //"vampire_katakan",
"crone_whispess", "crone_whispess",
"crone_brewess", "crone_brewess",
"crone_brewess",
"crone_whispess",
"crone_weavess",
"crone_weavess", "crone_weavess",
"arachas_behemoth", "arachas_behemoth",
"fire_elemental", "fire_elemental",

View File

@ -77,7 +77,7 @@ var App = Backbone.Router.extend({
var SideView = Backbone.View.extend({ var SideView = Backbone.View.extend({
el: ".container", el: ".container",
template: require("../templates/cards.handlebars"), template: require("../templates/cards.handlebars"),
templateCards: require("../templates/multipleCards.handlebars"), templateCards: require("../templates/fieldCards.handlebars"),
initialize: function(options){ initialize: function(options){
var self = this; var self = this;
this.side = options.side; this.side = options.side;

View File

@ -109,12 +109,27 @@ $game-height: 800px;
img { img {
height: 120px; height: 120px;
} }
span {
/*.card-attr-power {
margin-top: 0px;
margin-left: 0px;
height: 25px;
width: 25px;
text-align: center;
line-height: 25px;
font-size: 20px;
color: black;
}*/
.card-attr-positive {
color: #00b000; color: #00b000;
}
span {
color: #ff2d00;
font-weight: bold; font-weight: bold;
font-size: 20px; font-size: 20px;
position: absolute; position: absolute;
text-shadow: 1px 1px #101010; text-shadow: 1px 1px 0px #101010;
margin-top: 62px; margin-top: 62px;
margin-left: 0px; margin-left: 0px;
cursor: default; cursor: default;

View File

@ -1,6 +1,7 @@
{{#each this}} {{#each this}}
<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}"> <div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">
{{#if boost}}<span>+{{boost}}</span>{{/if}} {{#if diff}}<span class="card-attr-power {{#if diffPos}}card-attr-positive{{/if}}">{{diff}}</span>{{/if}}
<!--{{#if boost}}<span>+{{boost}}</span>{{/if}}-->
<img src="../assets/cards/{{_data.img}}.png"> <img src="../assets/cards/{{_data.img}}.png">
</div> </div>
{{/each}} {{/each}}

View File

@ -9,6 +9,7 @@ var Card = (function(){
/** /**
* constructor here * constructor here
*/ */
this.boost = 0;
this._uidEvents = {}; this._uidEvents = {};
this.setDisabled(false); this.setDisabled(false);
this._key = key; this._key = key;
@ -43,6 +44,10 @@ var Card = (function(){
}; };
r._uidEvents = null; r._uidEvents = null;
r.boost = null;
r.power = null;
r.diff = null;
r.diffPos = null;
r.getUidEvents = function(key){ r.getUidEvents = function(key){
return this._uidEvents[key]; return this._uidEvents[key];
@ -56,7 +61,7 @@ var Card = (function(){
return this._data.name; return this._data.name;
} }
r.getBasePower = function() { r.getBasePower = function(){
var base = this._data.power; var base = this._data.power;
if(this._forcedPower > -1){ if(this._forcedPower > -1){
base = this._forcedPower > this._data.power ? this._data.power : this._forcedPower; base = this._forcedPower > this._data.power ? this._data.power : this._forcedPower;
@ -65,12 +70,13 @@ var Card = (function(){
} }
r.getPower = function(){ r.getPower = function(){
this.power = null;
this.diff = null;
this.diffPos = null;
if(this._data.power === -1) return 0; if(this._data.power === -1) return 0;
return this.getBasePower() + this.getBoost(); this.diff = (this.power = (this.getBasePower() + this.getBoost())) - this.getRawPower();
/*if(this._forcedPower > -1){ if(this.diff > 0) this.diffPos = true;
return (this._forcedPower > this._data.power ? this._data.power : this._forcedPower) + this.getBoost(); return this.power;
}
return this._data.power + this.getBoost();*/
} }
r.getRawPower = function(){ r.getRawPower = function(){
return this._data.power; return this._data.power;