View Single Post
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767

Old December 28th, 2009, 09:15 PM
Quote:
Originally Posted by Mathias View Post
Let's say your advantage cost is stored in the adCost field.

So, this should be close to what you want:

Code:
 
if (hero.intersect[Start,Start] <> 0) then
  field[adCost].value -= 1
  endif
I have this in my traits.str is this what you mean by advantage cost?
<!-- Attribute component
Each attribute possessed by the actor derives from this component
-->
<component
id="Attribute"
name="Attribute"
autocompset="no">

<!-- Attributes have a minimum trait value of 1 -->
<eval index="1" phase="Initialize" priority="3000"><![CDATA[
field[trtMinimum].value = 1
]]></eval>


<!-- Each attribute point above one that is allocated by the user costs 4CP * the level, per level -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
var traitlevel as number
var traitcost as number
var finalvalue as number

traitlevel = field[trtUser].value
traitcost = 4

finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)

hero.child[resCP].field[resSpent].value += finalvalue - 12
]]></eval>

</component>
SAbel is offline   #24 Reply With Quote