Tweaked foundations' LOS so it depends on their sizes.

This was SVN commit r3567.
This commit is contained in:
Matei 2006-02-26 22:25:17 +00:00
parent 2e26b5e1da
commit c55b49164a
7 changed files with 55 additions and 28 deletions

View File

@ -18,6 +18,10 @@
<Depth>6.0</Depth>
<Height>8.0</Height>
</Footprint>
<Vision>
<LOS>2</LOS>
</Vision>
</Traits>

View File

@ -18,6 +18,10 @@
<Depth>9.0</Depth>
<Height>8.0</Height>
</Footprint>
<Vision>
<LOS>2</LOS>
</Vision>
</Traits>

View File

@ -18,6 +18,10 @@
<Depth>12.0</Depth>
<Height>8.0</Height>
</Footprint>
<Vision>
<LOS>3</LOS>
</Vision>
</Traits>

View File

@ -18,6 +18,10 @@
<Depth>18.0</Depth>
<Height>8.0</Height>
</Footprint>
<Vision>
<LOS>4</LOS>
</Vision>
</Traits>

View File

@ -18,6 +18,10 @@
<Depth>24.0</Depth>
<Height>8.0</Height>
</Footprint>
<Vision>
<LOS>5</LOS>
</Vision>
</Traits>

View File

@ -37,6 +37,7 @@ function entityInit()
this.traits.id.generic = building.traits.id.generic;
this.traits.id.specific = building.traits.id.specific;
this.traits.id.civ = building.traits.id.civ;
this.traits.id.icon_cell = building.traits.id.icon_cell;
this.traits.health.max = building.traits.health.max;
this.build_points = new Object();
this.build_points.curr = 0.0;
@ -186,31 +187,9 @@ function entityInit()
this.damage = damage;
this.entityComplete = entityComplete;
this.GotoInRange = GotoInRange;
this.attachAuras = attachAuras;
// Attach Auras if the entity is entitled to them.
if( this.traits.auras )
{
if( this.traits.auras.courage )
{
a = this.traits.auras.courage;
this.addAura ( "courage", a.radius, new DamageModifyAura( this, true, a.bonus ) );
}
if( this.traits.auras.fear )
{
a = this.traits.auras.fear;
this.addAura ( "fear", a.radius, new DamageModifyAura( this, false, -a.bonus ) );
}
if( this.traits.auras.infidelity )
{
a = this.traits.auras.infidelity;
this.addAura ( "infidelity", a.radius, new InfidelityAura( this, a.time ) );
}
if( this.traits.auras.dropsite )
{
a = this.traits.auras.dropsite;
this.addAura ( "dropsite", a.radius, new DropsiteAura( this, a.types ) );
}
}
this.attachAuras();
if ( !this.traits.id )
{
@ -290,6 +269,37 @@ function entityInit()
// ====================================================================
// Attach any auras the entity is entitled to. This was moved to a separate function so that buildings can have their auras
// attached to them only when they finish construction.
function attachAuras()
{
if( this.traits.auras )
{
if( this.traits.auras.courage )
{
a = this.traits.auras.courage;
this.addAura ( "courage", a.radius, new DamageModifyAura( this, true, a.bonus ) );
}
if( this.traits.auras.fear )
{
a = this.traits.auras.fear;
this.addAura ( "fear", a.radius, new DamageModifyAura( this, false, -a.bonus ) );
}
if( this.traits.auras.infidelity )
{
a = this.traits.auras.infidelity;
this.addAura ( "infidelity", a.radius, new InfidelityAura( this, a.time ) );
}
if( this.traits.auras.dropsite )
{
a = this.traits.auras.dropsite;
this.addAura ( "dropsite", a.radius, new DropsiteAura( this, a.types ) );
}
}
}
// ====================================================================
function foundationDestroyed( evt )
{
if( this.building != "" ) // Check that we're *really* a foundation since the event handler is kept when we change templates (probably a bug)
@ -523,6 +533,7 @@ function performBuild( evt )
{
t.template = getEntityTemplate( t.building );
t.building = "";
t.attachAuras();
}
evt.preventDefault(); // Stop performing this action
}

View File

@ -20,10 +20,6 @@
<Regen_Rate>0.0</Regen_Rate>
</Health>
<Vision>
<LOS>3</LOS>
</Vision>
</Traits>
<Script File="entities/template_entity_script.js" />