mirror of
https://github.com/RussellChamp/GrimoireJS.git
synced 2026-10-27 22:42:32 +00:00
Fixed some generation of intelligence items
This commit is contained in:
1 parent
9060276ee7
commit
919f2f9cf1
2 files changed
+13
-7
No files matched your search
+3
-2
@@ -1,4 +1,4 @@
|
|||||||
/*global _:false */
|
/*global _:false, console:false */
|
||||||
/*global Grimoire:true, Intelligence:true */
|
/*global Grimoire:true, Intelligence:true */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -523,7 +523,7 @@ Weapons.getWeapon = function(type, wClass, final) {
|
|||||||
console.log(type);
|
console.log(type);
|
||||||
console.log(wClass);
|
console.log(wClass);
|
||||||
console.log(final);
|
console.log(final);
|
||||||
console.log("roll: " + roll);
|
console.log('roll: ' + roll);
|
||||||
console.log(newWeapon);
|
console.log(newWeapon);
|
||||||
console.log(special);
|
console.log(special);
|
||||||
return err.stack;
|
return err.stack;
|
||||||
@@ -540,6 +540,7 @@ Weapons.getWeapon = function(type, wClass, final) {
|
|||||||
if(final === true && _.random(1,100) === 1) {
|
if(final === true && _.random(1,100) === 1) {
|
||||||
weapon.name = 'Intelligent ' + weapon.name;
|
weapon.name = 'Intelligent ' + weapon.name;
|
||||||
weapon.intelligence = Intelligence.getItemIntelligence(weapon.cost);
|
weapon.intelligence = Intelligence.getItemIntelligence(weapon.cost);
|
||||||
|
weapon.cost += weapon.intelligence.cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(final === true && _.random(1,100) <= 30) {
|
if(final === true && _.random(1,100) <= 30) {
|
||||||
|
|||||||
+10
-5
@@ -1,4 +1,6 @@
|
|||||||
/*global _:false */
|
/*global _:false */
|
||||||
|
/*global Intelligence:false */
|
||||||
|
"use strict";
|
||||||
var WondrousItems = {};
|
var WondrousItems = {};
|
||||||
WondrousItems.getAllItems = function() {
|
WondrousItems.getAllItems = function() {
|
||||||
return [
|
return [
|
||||||
@@ -488,25 +490,28 @@ WondrousItems.getItem = function(type, source) {
|
|||||||
//spell = _.sample(sourceSpells[type][level]);
|
//spell = _.sample(sourceSpells[type][level]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//I *know* that the APG has it's own roll table but I really don't care...
|
//I *know* that the APG has it"s own roll table but I really don"t care...
|
||||||
item = _.sample(sourceItems);
|
item = _.sample(sourceItems);
|
||||||
|
|
||||||
//remember that consumable items should NEVER have intelligence
|
//remember that consumable items should NEVER have intelligence
|
||||||
if(_.random(1,100) === 1)
|
if(_.random(1,100) === 1) {
|
||||||
item.name = "Intelligent " + item.name;
|
item.name = "Intelligent " + item.name;
|
||||||
|
item.intelligence = Intelligence.getItemIntelligence(item.cost);
|
||||||
|
item.cost += item.intelligence.cost;
|
||||||
|
}
|
||||||
if(_.random(1,100) <= 20)
|
if(_.random(1,100) <= 20)
|
||||||
item.name += " with a clue as to its purpose";
|
item.name += " with a clue as to its purpose";
|
||||||
return item;
|
return item;
|
||||||
};
|
};
|
||||||
|
|
||||||
WondrousItems.getMinor = function() {
|
WondrousItems.getMinor = function() {
|
||||||
return this.getItem('minor');
|
return this.getItem("minor");
|
||||||
};
|
};
|
||||||
|
|
||||||
WondrousItems.getMedium = function() {
|
WondrousItems.getMedium = function() {
|
||||||
return this.getItem('medium');
|
return this.getItem("medium");
|
||||||
};
|
};
|
||||||
|
|
||||||
WondrousItems.getMajor = function() {
|
WondrousItems.getMajor = function() {
|
||||||
return this.getItem('major');
|
return this.getItem("major");
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user