Additional Info
|
It seems like impassible tiles (eg water) count against your geoeffeciency even though you cant conquer them even if you wanted to. Is this intentional? Am I even correct? I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it. |
Level: 1
ADR Info
Additional Info
|
Yup. That's the intention. If you build around them, they count against your efficiency.
|
Additional Info
|
damn. I gambled on "having water in your village is a good thing". guess I lost. I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it. |
Additional Info
|
kolonelkadat Posted on: 01/12/2015 8:42pm damn. I gambled on "having water in your village is a good thing". guess I lost. |
Level: 1
ADR Info
Additional Info
|
Here's the current set of logic! $sql = 'SELECT map_x, map_y FROM War_Map WHERE nation_id = :nation_id'; $query = $COMMON->DB()->prepare($sql); $query->execute(array(':nation_id' => $this->nation_id)); $counter = 0; $coords = array(); while($row = $query->fetch()) { ++$counter; $coords[$row['map_x']][$row['map_y']] = 1; } if($counter < 50) { $this->set('nation_geo_eff',1); return 1; } $faces = 0; foreach($coords as $x => $batch) { foreach($batch as $y => $junk) { $hits = 4; if(isset($coords[$x + 1][$y])) { --$hits; } if(isset($coords[$x - 1][$y])) { --$hits; } if(isset($coords[$x][$y - 1])) { --$hits; } if(isset($coords[$x][$y + 1])) { --$hits; } $faces += $hits; } } // Each air combat removes 2 faces worth of damage // Defensive counts towards this value // Every 500 tiles adds 1 to the bonus value $bonus = 50 + $this->nation_attr_d_air_combat + $this->nation_attr_g_air_combat + floor($counter / 500); if($faces < $bonus) { $this->set('nation_geo_eff',1); return 1; } //Need to base this on the total divided out. $value = ($counter - ($faces/2) + $bonus) / $counter; if($value < 0.01) { $this->set('nation_geo_eff',0.01); return 0.01; } if($value > 1) { $this->set('nation_geo_eff',1); return 1; } $this->set('nation_geo_eff',round($value,2)); return round($value,2);
|