Permalink
Browse files

- Add links to Skill edit page and feat edit page.

- Add functionality to edit player defenses in playeredit page and Player->updateFromForm
  • Loading branch information...
1 parent d870f57 commit eb71e740668e173f519395438859c71adce8e2d9 @duaiwe committed Oct 4, 2009
Showing with 112 additions and 23 deletions.
  1. +2 −0 htdocs/.htaccess
  2. +1 −1 htdocs/css/statBlock.css
  3. +5 −1 htdocs/header.php
  4. +1 −1 htdocs/player.html
  5. +56 −20 htdocs/playerEdit.html
  6. +47 −0 includes/models/Player.php
View
@@ -19,6 +19,8 @@ RewriteRule ^import$ import.html
RewriteRule ^upload$ importProcess.php?action=upload
RewriteRule ^([0-9]+)/delete$ playerEdit.html?action=delete&id=$1
RewriteRule ^([0-9]+)/edit$ playerEdit.html?action=edit&id=$1
+RewriteRule ^([0-9]+)/skills$ skillEdit.html?id=$1
+RewriteRule ^([0-9]+)/skills$ featEdit.html?id=$1
RewriteRule ^([0-9]+)/power$ power.html?id=$1
RewriteRule ^([0-9]+)/power/new$ powerEdit.html?action=add&id=$1
RewriteRule ^([0-9]+)/power/([0-9]+)/edit$ powerEdit.html?action=edit&id=$1&p_id=$2
View
@@ -49,7 +49,7 @@ div.statRow label.statLabel {
font-weight : bold;
text-align : right;
margin : 0 10px 0 0;
- width : 65px;
+ width : 70px;
display : block;
float : left;
}
View
@@ -18,7 +18,11 @@
<li class="item"
><a href="<?=SITE_URL;?>/<?=$char->id;?>/edit">Edit</a></li>
<li class="item"
- ><a href="<?=SITE_URL;?>/<?=$char->id?>/power">Powers</a></li>
+ ><a href="<?=SITE_URL;?>/<?=$char->id;?>/power">Powers</a></li>
+ <li class="item"
+ ><a href="<?=SITE_URL;?>/<?=$char->id;?>/skills">Skills</a><li>
+ <li class="item"
+ ><a href="<?=SITE_URL;?>/<?=$char->id;?>/feats">Feats</a><li>
<li class="item"
><a href="<?=SITE_URL;?>/<?=$char->id;?>/delete">Delete</a></li>
</ul>
View
@@ -83,7 +83,7 @@
</div>
</div>
<div class="statRow">
- <label class="statLabel">Temp Health:</label>
+ <label class="statLabel">Tmp Health:</label>
<div class="statInfo">
<input type="text" id="health" value="" size="3" maxlength="3" />
<a href="#" id="tempHealth" class="ajaxLink">Temp Health</a>
View
@@ -72,6 +72,18 @@
</div>
<div class="formRow optional">
+ <label for="health_bonus"
+ class="<?=$char->hasError('health_bonus',$form_key)?'error':'';?>"
+ >Bonus Health: <span class="help" title="Bonus Health: Optional. If you have an ability that grants additional health (e.g. Toughness), enter the total extra health you get here.">?</span>
+ </label>
+ <div class="field">
+ <input type="text" size="5" maxlength="4"
+ id="health_bonus" name="health_bonus"
+ value="<?=$char->getCached('health_bonus', $form_key);?>" />
+ </div>
+ </div>
+
+ <div class="formRow optional">
<label for="surges_bonus"
class="<?=$char->hasError('surges_bonus',$form_key)?'error':'';?>"
>Bonus Surges: <span class="help" title="Bonus Surges: Optional. If you have an ability that grants additional surges, enter the total extra surges you have here.">?</span>
@@ -106,7 +118,21 @@
value="<?=$char->getCached('general_attack',$form_key);?>" />
</div>
</div>
-
+
+ <div class="formRow optional">
+ <label for="ac"
+ class="<?=$char->hasError('ac',$form_key)?'error':'';?>"
+ >Armor Class: <span class="help" title="Armor Class: Armor and any other bonuses that apply to your armor class; NOT including level or ability score.">?</span>
+ </label>
+ <div class="field">
+ <input type="text" size="3" maxlength="3" id="ac" name="ac"
+ value="<?=$char->getCached('ac',$form_key);?>" />
+ <label for="ac_heavy">Heavy: <span class="help" title="Heavy Armor: Check this if you are wearing heavy armor.">?</span></label>
+ <input type="checkbox" id="ac_heavy" name="ac_heavy" value="1"
+ <?=$char->getCached('ac_heavy',$form_key)?'checked="checked"':''?> />
+ </div>
+ </div>
+
</div><!-- end div.leftColumn -->
<div class="formColumn rightColumn">
@@ -168,33 +194,43 @@
</div>
<div class="formRow optional">
- <label for="health_bonus"
- class="<?=$char->hasError('health_bonus',$form_key)?'error':'';?>"
- >Bonus Health: <span class="help" title="Bonus Health: Optional. If you have an ability that grants additional health (e.g. Toughness), enter the total extra health you get here.">?</span>
+ <label for="fort"
+ class="<?=$char->hasError('fort',$form_key)?'error':'';?>"
+ >Fort: <span class="help" title="Bonus Fortitude: Optional. Any bonuses that apply to your fortitude defense, NOT including level, ability score, or class.">?</span>
</label>
<div class="field">
<input type="text" size="5" maxlength="4"
- id="health_bonus" name="health_bonus"
- value="<?=$char->getCached('health_bonus', $form_key);?>" />
+ id="fort" name="fort"
+ value="<?=$char->getCached('fort', $form_key);?>" />
+ </div>
+ </div>
+
+ <div class="formRow optional">
+ <label for="ref"
+ class="<?=$char->hasError('ref',$form_key)?'error':'';?>"
+ >Ref: <span class="help" title="Bonus Reflex: Optional. Any bonuses that apply to your reflex defense, NOT including level, ability score, or class.">?</span>
+ </label>
+ <div class="field">
+ <input type="text" size="5" maxlength="4"
+ id="ref" name="ref"
+ value="<?=$char->getCached('ref', $form_key);?>" />
+ </div>
+ </div>
+ <div class="formRow optional">
+ <label for="will"
+ class="<?=$char->hasError('will',$form_key)?'error':'';?>"
+ >Will: <span class="help" title="Bonus Will: Optional. Any bonuses that apply to your wil defense, NOT including level, ability score, or class.">?</span>
+ </label>
+ <div class="field">
+ <input type="text" size="5" maxlength="4"
+ id="will" name="will"
+ value="<?=$char->getCached('will', $form_key);?>" />
</div>
</div>
</div><!-- end div.rightColumn -->
-<div class="clear"></div>
-
-<!--
-main hand name
-main hand attack/damage bonus
-main hand dice
-
-off hand name
-off hand attack/damage bonus
-off hand dice
-
-implement name
-implement attack/damage bonus
--->
+<hr class="clear"/>
<div class="formColumn leftColumn">
View
@@ -380,6 +380,50 @@ public function updateFromForm() {
$this->surge_value_bonus = (int)$_POST['surge_value_bonus'];
}
+ // Fortitude
+ $cache['fort'] = $_POST['fort'];
+ if( !is_numeric($_POST['fort']) ) {
+ $msg->add('Fort bonus must be an integer.', Message::WARNING);
+ $cache['error'][] = 'fort';
+ }
+ else {
+ $this->fort = (int)$_POST['fort'];
+ }
+ // Reflex
+ $cache['ref'] = $_POST['ref'];
+ if( !is_numeric($_POST['ref']) ) {
+ $msg->add('Ref bonus must be an integer.', Message::WARNING);
+ $cache['error'][] = 'ref';
+ }
+ else {
+ $this->ref = (int)$_POST['ref'];
+ }
+ // Will
+ $cache['will'] = $_POST['will'];
+ if( !is_numeric($_POST['will']) ) {
+ $msg->add('Will bonus must be an integer.', Message::WARNING);
+ $cache['error'][] = 'will';
+ }
+ else {
+ $this->will = (int)$_POST['will'];
+ }
+
+ // Armor Class
+ $cache['ac'] = $_POST['ac'];
+ if( !is_numeric($_POST['ac']) ) {
+ $msg->add('Armor Class bonus must be an integer.', Message::WARNING);
+ $cache['error'][] = 'ac';
+ }
+ else {
+ $this->ac = (int)$_POST['ac'];
+ }
+
+ // Heavy Armor
+ $this->ac_heavy = !empty($_POST['ac_heavy']);
+
+
+ // End Model Data Updates
+
// Update the form cache in the session if necessary.
if( !empty($_POST['form_key']) ) {
if( empty($cache['error']) ) {
@@ -569,16 +613,19 @@ public function getDefense($def) {
case 'fort':
$result += $this->fort;
$result += max($this->getMod('str'),$this->getMod('con'));
+ $result += $this->Archetype->fort;
break;
case 'reflex':
case 'ref':
$result += $this->ref;
$result += max($this->getMod('dex'),$this->getMod('int'));
+ $result += $this->Archetype->ref;
break;
case 'willpower':
case 'will':
$result += $this->will;
$result += max($this->getMod('wis'),$this->getMod('cha'));
+ $result += $this->Archetype->will;
break;
case 'armor class':
case 'ac':

0 comments on commit eb71e74

Please sign in to comment.