[charactermanager] r341 committed - change available weapons on class change

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 2, 2009, 7:12:35 AM10/2/09
to characterman...@googlegroups.com
Revision: 341
Author: todd.chambery
Date: Fri Oct 2 04:12:16 2009
Log: change available weapons on class change
http://code.google.com/p/charactermanager/source/detail?r=341

Modified:
/trunk/charmgrjs/edit.js
/trunk/charmgrjs/spells.js

=======================================
--- /trunk/charmgrjs/edit.js Wed Sep 30 20:19:16 2009
+++ /trunk/charmgrjs/edit.js Fri Oct 2 04:12:16 2009
@@ -359,7 +359,12 @@
}

function populate_weapons_part(char_weapons) {
- for (j in char_weapons) {
+ for (var j in char_weapons) {
+ curr_weapon_sel = $("select[id='weapon_" + j + "']").val();
+ // create new select from available weapons
+ // remove current select
+ // replace with select
+ // select curr_weapon_sel
var weapon = weapons.first( {
id : char_weapons[j].weapon_id
});
@@ -447,7 +452,7 @@
}
}
// check class feat
- if(is_class_feat(chardata.class_id, 43, chardata.xp)) {
+ if(is_class_feat($('#clazz').val(), 43, $('#xp').val())) {
martial_weapons = weapons.get({ category: "martial" });
} else if(chardata.feats){
var martial_weapons_feat = chardata.feats.first({ feat_id: 43 });
@@ -458,10 +463,11 @@
}
}

- return simple_weapons.concat(martial_weapons).concat(exotic_weapons);
+ var avail_weapons =
simple_weapons.concat(martial_weapons).concat(exotic_weapons);
+ return avail_weapons.sort(function(a,b){ return a.name < b.name ? -1 : 1;
});
}

-function update_log(chardata){
+function update_log(chardata) {
if (chardata.xp_log == null) {
chardata.xp_log = [];
}
=======================================
--- /trunk/charmgrjs/spells.js Wed Sep 30 20:19:16 2009
+++ /trunk/charmgrjs/spells.js Fri Oct 2 04:12:16 2009
@@ -3542,7 +3542,7 @@
save: "Will negs",
sr: "Yes",
phb: 237,
- detail: ""
+ detail: "This spell instills powerful hope in the subjects. Each
affected creature gains a +2 morale bonus on saving throws, attack rolls,
ability checks, skill checks, and weapon damage rolls. <p class=sub><i>Good
hope</i> counters and dispels <i>crushing despair</i>."
}, {
id: 234,
name: "Grease",
@@ -3557,7 +3557,7 @@
save: "Special",
sr: "-",
phb: 237,
- detail: ""
+ detail: "A <i>grease</i> spell covers a solid surface with a layer of
slippery grease. Any creature in the area when the spell is cast must make
a successful Reflex save or fall. This save is repeated on your turn each
round that the creature remains within the area. A crea-ture can walk
within or through the area of grease at half normal speed with a DC 10
Balance check. Failure means it can’t move that round (and must then make a
Reflex save or fall), while failure by 5 or more means it falls (see the
Balance skill for details). <p class=sub>The DM should adjust saving throws
by circumstance. For example, a creature charging down an incline that is
suddenly <i>greased</i> has little chance to avoid the effect, but its
ability to exit the affected area is almost assured (whether it wants to or
not). <p class=sub>The spell can also be used to create a greasy coating on
an item—a rope, ladder rungs, or a weapon handle, for instance. Material
objects not in use are always af-fected by this spell, while an object
wielded or employed by a creature receives a Reflex saving throw to avoid
the effect. If the initial saving throw fails, the creature immediately
drops the item. A saving throw must be made in each round that the creature
attempts to pick up or use the greased item. A creature wearing
<i>greased</i> armor or clothing gains a +10 circumstance bonus on Escape
Artist checks and on grapple checks made to resist or escape a grapple or
to escape a pin. <p class=sub><i>Material Component</i>: A bit of pork rind
or butter."
}, {
id: 235,
name: "Guards and Wards",
@@ -3572,7 +3572,7 @@
save: "-",
sr: "-",
phb: 237,
- detail: ""
+ detail: "This powerful spell is primarily used to defend your
stronghold. The ward protects 200 square feet per caster level. The warded
area can be as much as 20 feet high, and shaped as you desire. You can ward
several stories of a stronghold by dividing the area among them; you must
be somewhere within the area to be warded to cast the spell. The spell
creates the following magical effects within the warded area. <p
class=sub><i>Fog</i>: Fog fills all corridors, obscuring all sight,
including darkvision, beyond 5 feet. A creature within 5 feet has
concealment (attacks have a 20% miss chance). Creatures farther away have
total concealment (50% miss chance, and the attacker cannot use sight to
locate the target). Saving Throw: None. Spell Resistance: No. <p
class=sub><i>Arcane Locks</i>: All doors in the warded area are arcane
locked. Saving Throw: None. Spell Resistance: No. <p class=sub><i>Webs</i>:
Webs fill all stairs from top to bottom. These strands are identical with
those created by the web spell, except that they regrow in 10 minutes if
they are burned or torn away while the guards and wards spell lasts. Saving
Throw: Reflex negates; see text for web. Spell Resistance: No. <p
class=sub><i>Confusion</i>: Where there are choices in direction—such as a
corridor intersection or side passage—a minor <i>confusion</i>-type effect
functions so as to make it 50% probable that intruders believe they are
going in the opposite direction from the one they actually chose. This is
an en-chantment, mind-affecting effect. Saving Throw: None. Spell
Resistance: Yes. <p class=sub><i>Lost Doors</i>: One door per caster level
is covered by a silent image to appear as if it were a plain wall. Saving
Throw: Will disbelief (if interacted with). Spell Resistance: No. <p
class=sub>In addition, you can place your choice of one of the following
five magical effects. <p class=sub><i>1. <i>Dancing lights</i> in four
corridors. You can designate a simple program that causes the lights to
repeat as long as the <i>guards and wards</i> spell lasts. Saving
Throw</i>: None. Spell Resistance: No. <p class=sub><i>2. A <i>magic
mouth</i> in two places. Saving Throw</i>: None. Spell Resistance: No. <p
class=sub><i>3. A <i>stinking cloud</i> in two places. The vapors appear in
the places you designate; they return within 10 minutes if dispersed by
wind while the <i>guards and wards</i> spell lasts. Saving Throw</i>:
Fortitude negates; see text for <i>stinking cloud</i>. Spell Resistance:
No. <p class=sub><i>4. A <i>gust of wind</i> in one corridor or room.
Saving Throw</i>: Fortitude negates. Spell Resistance: Yes. <p
class=sub><i>5. A <i>suggestion</i> in one place. You select an area of up
to 5 feet square, and any creature who enters or passes through the area
receives the <i>suggestion</i> mentally. Saving Throw</i>: Will negates.
Spell Resistance: Yes. <p class=sub>The whole warded area radiates strong
magic of the abjuration school. A dispel magic cast on a specific effect,
if successful, removes only that effect. A successful <i>Mordenkainen’s
disjunction</i> destroys the entire <i>guards and wards</i> effect. <p
class=sub><i>Material Component</i>: Burning incense, a small measure of
brimstone and oil, a knotted string, and a small amount of blood. <p
class=sub><i>Focus</i>: A small silver rod."
}, {
id: 236,
name: "Guidance",
@@ -3587,7 +3587,7 @@
save: "Will negs",
sr: "Yes",
phb: 238,
- detail: ""
+ detail: "This spell imbues the subject with a touch of divine
guidance. The creature gets a +1 competence bonus on a single attack roll,
saving throw, or skill check. It must choose to use the bonus before making
the roll to which it applies."
}, {
id: 237,
name: "Gust of Wind",
@@ -3602,7 +3602,7 @@
save: "Fort negs",
sr: "Yes",
phb: 238,
- detail: ""
+ detail: "This spell creates a severe blast of air (approximately 50
mph) that originates from you, affecting all creatures in its path. A Tiny
or smaller creature on the ground is knocked down and rolled 1d4×10 feet,
taking 1d4 points of nonlethal damage per 10 feet. If flying, a Tiny or
smaller creature is blown back 2d6×10 feet and takes 2d6 points of
nonlethal damage due to battering and buffeting. <p class=sub>Small
creatures are knocked prone by the force of the wind, or if flying are
blown back 1d6×10 feet. <p class=sub>Medium creatures are unable to move
forward against the force of the wind, or if flying are blown back 1d6×5
feet. <p class=sub>Large or larger creatures may move normally within a
<i>gust of wind</i> effect. <p class=sub>A <i>gust of wind</i> can’t move a
creature beyond the limit of its range. <p class=sub>Any creature,
regardless of size, takes a -4 penalty on ranged attacks and Listen checks
in the area of a <i>gust of wind.</i> <p class=sub>The force of the gust
automatically extinguishes candles, torches, and similar unprotected
flames. It causes protected flames, such as those of lanterns, to dance
wildly and has a 50% chance to extinguish those lights. <p class=sub>In
addition to the effects noted, a <i>gust of wind</i> can do anything that a
sudden blast of wind would be expected to do. It can create a stinging
spray of sand or dust, fan a large fire, overturn delicate awnings or
hangings, heel over a small boat, and blow gases or vapors to the edge of
its range. <p class=sub><i>Gust of wind</i> can be made permanent with a
permanency spell."
}, {
id: 238,
name: "Hallow",
@@ -3632,7 +3632,7 @@
save: "Will dsblf",
sr: "-",
phb: 238,
- detail: ""
+ detail: "You make natural terrain look, sound, and smell like some
other sort of natural ter-rain. Thus, open fields or a road can be made to
resemble a swamp, hill, crevasse, or some other difficult or impassable
terrain. A pond can be made to seem like a grassy meadow, a precipice like
a gentle slope, or a rock-strewn gully like a wide and smooth road.
Structures, equipment, and creatures within the area are not hid-den or
changed in appearance. <p class=sub><i>Material Component</i>: A stone, a
twig, and a bit of green plant."
}, {
id: 240,
name: "Halt Undead",
Reply all
Reply to author
Forward
0 new messages