Barriers

From TheReincarnation
Revision as of 13:04, 24 March 2008 by Groentje (talk | contribs)
Jump to: navigation, search

Magical barriers block enemy's spells and items to your country. Requiring certain formula and technique, only an Archmage can build a barrier. There's no way to order anything when you are concentrating to build them. Higher rate of barriers will increase the chance of protecting yourself from various kind of magical attacks.


  • Barriers provide no space for population, vs 10 for wilderness.
  • Barriers require 30 m.p./turn upkeep

Building barriers

  • The number of Workshops does not increase the building rate for barriers (these are magical buildings)
  • If you build 50 barriers at once you will pay upkeep for 50 barriers for 50 turns at a cost of 75,000 mana in upkeep alone.
  • Building them one turn at a time saves you ~37,500 mana.
    • of course the faster you move, the less you risk being attacked while building barriers...

Program Code of Barriers

Source: [1]

sub spell_resisted {

my $caster_mage = shift;
my $target_mage = shift;
my $spell_color = shift;
my $barrier_resistance = $target_mage->getBarrierResistance() / 100;
my $sl_resistance = 0;
my $barrier_piercing = $caster_mage->{mage_spellpiercing} / 100;
my $color_resistance = 0;
$color_resistance = $target_mage->getResistanceNether() if $spell_color eq 'NETHER';
$color_resistance = $target_mage->getResistancePhantasm() if $spell_color eq 'PHANTASM';
$color_resistance = $target_mage->getResistanceAscendant() if $spell_color eq 'ASCENDANT';
$color_resistance = $target_mage->getResistanceVerdant() if $spell_color eq 'VERDANT';
$color_resistance = $target_mage->getResistanceEradication() if $spell_color eq 'ERADICATION';
$color_resistance = 75 if $color_resistance > 75;
#Spell Penetration also reduces color resistance
$color_resistance -= $caster_mage->{mage_spellpiercing};
$color_resistance = 0 if $color_resistance < 0;
$color_resistance /= 100;
#check barriers
if ( rand() < ($barrier_resistance + $sl_resistance - $barrier_piercing)) {
return 0;
}
#check resistances
if (rand() < $color_resistance) {
return 1;
}
#not blocked
return 2;

}