mirror of
https://github.com/RussellChamp/GrimoireJS.git
synced 2026-10-27 22:42:32 +00:00
modified energy resistance specials
This commit is contained in:
1 parent
4655191030
commit
d8b4dd54e3
4 files changed
+41
-10
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
/*global _:false */
|
/*global _:false */
|
||||||
|
/*global Grimoire:true */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
//TODO: Program the "Roll twice" logic
|
//TODO: Program the "Roll twice" logic
|
||||||
@@ -83,7 +84,7 @@ Armors.getSpecials = function() {
|
|||||||
{'name': 'Spell resistance (13)', 'bonus': 2, 'cost': 0},
|
{'name': 'Spell resistance (13)', 'bonus': 2, 'cost': 0},
|
||||||
{'name': 'Improved Slick', 'bonus': 0, 'cost': 15000},
|
{'name': 'Improved Slick', 'bonus': 0, 'cost': 15000},
|
||||||
{'name': 'Improved Shadow', 'bonus': 0, 'cost': 15000},
|
{'name': 'Improved Shadow', 'bonus': 0, 'cost': 15000},
|
||||||
{'name': 'Energy resistance', 'bonus': 0, 'cost': 18000},
|
{'name': 'Energy resistance (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 18000},
|
||||||
{'name': 'Ghost touch', 'bonus': 3, 'cost': 0},
|
{'name': 'Ghost touch', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Invulnerability', 'bonus': 3, 'cost': 0},
|
{'name': 'Invulnerability', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Moderate Fortification', 'bonus': 3, 'cost': 0},
|
{'name': 'Moderate Fortification', 'bonus': 3, 'cost': 0},
|
||||||
@@ -91,19 +92,20 @@ Armors.getSpecials = function() {
|
|||||||
{'name': 'Wild', 'bonus': 3, 'cost': 0},
|
{'name': 'Wild', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Slick, greater', 'bonus': 0, 'cost': 33750},
|
{'name': 'Slick, greater', 'bonus': 0, 'cost': 33750},
|
||||||
{'name': 'Shadow, greater', 'bonus': 0, 'cost': 33750},
|
{'name': 'Shadow, greater', 'bonus': 0, 'cost': 33750},
|
||||||
{'name': 'Improved Energy resistance', 'bonus': 0, 'cost': 42000},
|
{'name': 'Improved Energy resistance (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 42000},
|
||||||
{'name': 'Spell resistance (17)', 'bonus': 4, 'cost': 0},
|
{'name': 'Spell resistance (17)', 'bonus': 4, 'cost': 0},
|
||||||
{'name': 'Etherealness', 'bonus': 0, 'cost': 49000},
|
{'name': 'Etherealness', 'bonus': 0, 'cost': 49000},
|
||||||
{'name': 'Undead controlling', 'bonus': 0, 'cost': 49000},
|
{'name': 'Undead controlling', 'bonus': 0, 'cost': 49000},
|
||||||
{'name': 'Fortification, heavy', 'bonus': 5, 'cost': 0},
|
{'name': 'Fortification, heavy', 'bonus': 5, 'cost': 0},
|
||||||
{'name': 'Spell resistance (19)', 'bonus': 5, 'cost': 0},
|
{'name': 'Spell resistance (19)', 'bonus': 5, 'cost': 0},
|
||||||
{'name': 'Energy resistance, greater', 'bonus': 0, 'cost': 66000}
|
{'name': 'Energy resistance, greater (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 66000}
|
||||||
//100 Roll again twice
|
//100 Roll again twice
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
Armors.getSpecial = function(type) {
|
Armors.getSpecial = function(type) {
|
||||||
var roll = _.random(1,100);
|
var roll = _.random(1,100);
|
||||||
|
var s1, s2;
|
||||||
if(type == 'minor') {
|
if(type == 'minor') {
|
||||||
switch(true) {
|
switch(true) {
|
||||||
case (roll <= 25): return Armors.getSpecials()[0];
|
case (roll <= 25): return Armors.getSpecials()[0];
|
||||||
@@ -113,7 +115,10 @@ Armors.getSpecial = function(type) {
|
|||||||
case (roll <= 96): return Armors.getSpecials()[4];
|
case (roll <= 96): return Armors.getSpecials()[4];
|
||||||
case (roll <= 97): return Armors.getSpecials()[5];
|
case (roll <= 97): return Armors.getSpecials()[5];
|
||||||
case (roll <= 99): return Armors.getSpecials()[6];
|
case (roll <= 99): return Armors.getSpecials()[6];
|
||||||
case (roll <= 100): /*roll twice*/ break;
|
case (roll <= 100): //roll twice
|
||||||
|
s1 = Armors.getSpecial('minor');
|
||||||
|
s2 = Armors.getSpecial('minor');
|
||||||
|
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(type == 'medium') {
|
else if(type == 'medium') {
|
||||||
@@ -131,7 +136,10 @@ Armors.getSpecial = function(type) {
|
|||||||
case (roll <= 89): return Armors.getSpecials()[10];
|
case (roll <= 89): return Armors.getSpecials()[10];
|
||||||
case (roll <= 94): return Armors.getSpecials()[11];
|
case (roll <= 94): return Armors.getSpecials()[11];
|
||||||
case (roll <= 99): return Armors.getSpecials()[12];
|
case (roll <= 99): return Armors.getSpecials()[12];
|
||||||
case (roll <= 100): /*roll twice*/ break;
|
case (roll <= 100): //roll twice
|
||||||
|
s1 = Armors.getSpecial('medium');
|
||||||
|
s2 = Armors.getSpecial('medium');
|
||||||
|
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(type == 'major') {
|
else if(type == 'major') {
|
||||||
@@ -155,17 +163,26 @@ Armors.getSpecial = function(type) {
|
|||||||
case (roll <= 92): return Armors.getSpecials()[19];
|
case (roll <= 92): return Armors.getSpecials()[19];
|
||||||
case (roll <= 94): return Armors.getSpecials()[20];
|
case (roll <= 94): return Armors.getSpecials()[20];
|
||||||
case (roll <= 99): return Armors.getSpecials()[21];
|
case (roll <= 99): return Armors.getSpecials()[21];
|
||||||
case (roll <= 100): /*roll twice*/ break;
|
case (roll <= 100): //roll twice
|
||||||
|
s1 = Armors.getSpecial('major');
|
||||||
|
s2 = Armors.getSpecial('major');
|
||||||
|
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(['minor','medium','major'].indexOf(type) >= 0 && roll == 100) {
|
if(['minor','medium','major'].indexOf(type) >= 0 && roll == 100) {
|
||||||
var special1 = Armors.getSpecial(type);
|
var special1 = Armors.getSpecial(type);
|
||||||
var special2 = Armors.getSpecial(type);
|
var special2 = Armors.getSpecial(type);
|
||||||
//there exists a possibility of getting the same bonus or a bonus over +10
|
//there exists a possibility of getting the same bonus
|
||||||
//this is hilarious and has not been fixed
|
//this is hilarious and has not been fixed
|
||||||
|
if(special1.bonus + special2.bonus <= 10) {
|
||||||
return {'name': special1.name + ' ' + special2.name,
|
return {'name': special1.name + ' ' + special2.name,
|
||||||
'bonus': special1.bonus + special2.bonus,
|
'bonus': special1.bonus + special2.bonus,
|
||||||
'cost': special1.cost + special2.cost
|
'cost': special1.cost + special2.cost
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//return the special with the better bonus.
|
||||||
|
return (special1.bonus > special2.bonus ? special1 : special2);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/*global _:false */
|
||||||
|
/*global Grimoire:true */
|
||||||
|
'use strict';
|
||||||
|
Grimoire.getEnergyResistance = function() {
|
||||||
|
return _.sample(['acid', 'cold', 'electricity', 'fire', 'sonic']);
|
||||||
|
};
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
<script type="application/javascript" src="potions.js"></script>
|
<script type="application/javascript" src="potions.js"></script>
|
||||||
<script type="application/javascript" src="wands.js"></script>
|
<script type="application/javascript" src="wands.js"></script>
|
||||||
<script type="application/javascript" src="staves.js"></script>
|
<script type="application/javascript" src="staves.js"></script>
|
||||||
|
<script type="application/javascript" src="energy.js"></script>
|
||||||
<script type="application/javascript" src="armors.js"></script>
|
<script type="application/javascript" src="armors.js"></script>
|
||||||
<script type="application/javascript" src="shields.js"></script>
|
<script type="application/javascript" src="shields.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
+10
-3
@@ -1,4 +1,5 @@
|
|||||||
/*global _:false */
|
/*global _:false */
|
||||||
|
/*global Grimoire:true */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
//TODO: Program the "Roll twice" logic
|
//TODO: Program the "Roll twice" logic
|
||||||
@@ -77,18 +78,18 @@ Shields.getSpecials = function() {
|
|||||||
{'name': 'Arrow deflection', 'bonus': 2, 'cost': 0},
|
{'name': 'Arrow deflection', 'bonus': 2, 'cost': 0},
|
||||||
{'name': 'Animated', 'bonus': 2, 'cost': 0},
|
{'name': 'Animated', 'bonus': 2, 'cost': 0},
|
||||||
{'name': 'Spell resistance (13)', 'bonus': 2, 'cost': 0},
|
{'name': 'Spell resistance (13)', 'bonus': 2, 'cost': 0},
|
||||||
{'name': 'Energy resistance', 'bonus': 0, 'cost': 18000},
|
{'name': 'Energy resistance (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 18000},
|
||||||
{'name': 'Ghost touch', 'bonus': 3, 'cost': 0},
|
{'name': 'Ghost touch', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Moderate Fortification', 'bonus': 3, 'cost': 0},
|
{'name': 'Moderate Fortification', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Spell resistance (15)', 'bonus': 3, 'cost': 0},
|
{'name': 'Spell resistance (15)', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Wild', 'bonus': 3, 'cost': 0},
|
{'name': 'Wild', 'bonus': 3, 'cost': 0},
|
||||||
{'name': 'Improved Energy resistance', 'bonus': 0, 'cost': 42000},
|
{'name': 'Improved Energy resistance (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 42000},
|
||||||
{'name': 'Spell resistance (17)', 'bonus': 4, 'cost': 0},
|
{'name': 'Spell resistance (17)', 'bonus': 4, 'cost': 0},
|
||||||
{'name': 'Undead controlling', 'bonus': 0, 'cost': 49000},
|
{'name': 'Undead controlling', 'bonus': 0, 'cost': 49000},
|
||||||
{'name': 'Fortification, heavy', 'bonus': 5, 'cost': 0},
|
{'name': 'Fortification, heavy', 'bonus': 5, 'cost': 0},
|
||||||
{'name': 'Reflecting', 'bonus': 5, 'cost': 0},
|
{'name': 'Reflecting', 'bonus': 5, 'cost': 0},
|
||||||
{'name': 'Spell resistance (19)', 'bonus': 5, 'cost': 0},
|
{'name': 'Spell resistance (19)', 'bonus': 5, 'cost': 0},
|
||||||
{'name': 'Energy resistance, greater', 'bonus': 0, 'cost': 6600}
|
{'name': 'Energy resistance, greater (' + Grimoire.getEnergyResistance() + ')', 'bonus': 0, 'cost': 6600}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -151,9 +152,15 @@ Shields.getSpecial = function(type) {
|
|||||||
var special2 = Shields.getSpecial(type);
|
var special2 = Shields.getSpecial(type);
|
||||||
//there exists a possibility of getting the same bonus or a bonus over +10
|
//there exists a possibility of getting the same bonus or a bonus over +10
|
||||||
//this is hilarious and has not been fixed
|
//this is hilarious and has not been fixed
|
||||||
|
if(special1.bonus + special2.bonus <= 10) {
|
||||||
return {'name': special1.name + ' ' + special2.name,
|
return {'name': special1.name + ' ' + special2.name,
|
||||||
'bonus': special1.bonus + special2.bonus,
|
'bonus': special1.bonus + special2.bonus,
|
||||||
'cost': special1.cost + special2.cost
|
'cost': special1.cost + special2.cost
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//return the special with the better bonus.
|
||||||
|
return (special1.bonus > special2.bonus ? special1 : special2);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user