____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

script_spell.cpp File Reference

The spell script functions.. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include "spells.h"
#include "sound.h"
#include "script.h"
#include "missile.h"
#include "unittype.h"
#include "upgrade.h"

Go to the source code of this file.

Functions

static void CclSpellMissileLocation (lua_State *l, SpellActionMissileLocation *location)
static SpellActionTypeCclSpellAction (lua_State *l)
char Ccl2Condition (lua_State *l, const char *value)
static void CclSpellCondition (lua_State *l, ConditionInfo *condition)
static void CclSpellAutocast (lua_State *l, AutoCastInfo *autocast)
static int CclDefineSpell (lua_State *l)
void SpellCclRegister (void)
 < register fonction.


Detailed Description

The spell script functions..

Definition in file script_spell.cpp.


Function Documentation

char Ccl2Condition ( lua_State *  l,
const char *  value 
)

Get a condition value from a scm object.

Parameters:
l Lua state.
value scm value to convert.
Returns:
CONDITION_TRUE, CONDITION_FALSE, CONDITION_ONLY or -1 on error.
Note:
This is a helper function to make CclSpellCondition shorter and easier to understand.

Definition at line 477 of file script_spell.cpp.

References _C_, CONDITION_FALSE, CONDITION_ONLY, CONDITION_TRUE, and LuaError.

Referenced by CclSpellAutocast(), and CclSpellCondition().

static int CclDefineSpell ( lua_State *  l  )  [static]

static SpellActionType* CclSpellAction ( lua_State *  l  )  [static]

Parse the action for spell.

Parameters:
l Lua state.

Definition at line 117 of file script_spell.cpp.

References _C_, SpellActionTypeAdjustVariable::AddIncrease, SpellActionTypeAdjustVariable::AddMax, SpellActionTypeAdjustVariable::AddValue, CclSpellMissileLocation(), Capture::Damage, Demolish::Damage, AreaBombardment::Damage, SpawnMissile::Damage, Capture::DamagePercent, DebugPrint, SpawnMissile::Delay, SpellActionTypeAdjustVariable::Enable, SpawnMissile::EndPoint, AreaBombardment::Fields, GetVariableIndex(), AdjustVitals::HP, AreaAdjustVitals::HP, SpellActionTypeAdjustVariable::Increase, SpellActionTypeAdjustVariable::IncreaseTime, SpellActionTypeAdjustVariable::InvertEnable, LuaError, LuaToBoolean(), LuaToNumber(), LuaToString(), AdjustVitals::Mana, AreaAdjustVitals::Mana, SpellActionTypeAdjustVariable::Max, AdjustVitals::MaxMultiCast, AreaBombardment::Missile, SpawnMissile::Missile, MissileTypeByIdent(), SpellActionTypeAdjustVariable::ModifEnable, SpellActionTypeAdjustVariable::ModifIncrease, SpellActionTypeAdjustVariable::ModifMax, SpellActionTypeAdjustVariable::ModifValue, Polymorph::NewForm, CUnitTypeVar::NumberVariable, Polymorph::PlayerNeutral, SpawnPortal::PortalType, Demolish::Range, Summon::RequireCorpse, Capture::SacrificeEnable, AreaBombardment::Shards, AreaBombardment::StartOffsetX, AreaBombardment::StartOffsetY, SpawnMissile::StartPoint, SpellActionTypeAdjustVariable::TargetIsCaster, Summon::TTL, SpawnMissile::TTL, Summon::UnitType, UnitTypeByIdent(), UnitTypeVar, SpellActionTypeAdjustVariable::Value, and AdjustVariable::Var.

Referenced by CclDefineSpell().

static void CclSpellAutocast ( lua_State *  l,
AutoCastInfo autocast 
) [static]

Parse the Condition for spell.

Parameters:
l Lua state.
autocast pointer to autocast to fill with data.
Note:
: autocast must be allocated. All data already in is LOST.

Definition at line 595 of file script_spell.cpp.

References _C_, Ccl2Condition(), CclSpellCondition(), AutoCastInfo::Combat, AutoCastInfo::Condition, LuaError, LuaToNumber(), LuaToString(), and AutoCastInfo::Range.

Referenced by CclDefineSpell().

static void CclSpellCondition ( lua_State *  l,
ConditionInfo condition 
) [static]

static void CclSpellMissileLocation ( lua_State *  l,
SpellActionMissileLocation location 
) [static]

Parse the missile location description for a spell action.

Parameters:
l Lua state.
location Pointer to missile location description.
Note:
This is only here to avoid code duplication. You don't have any reason to USE this:)

Definition at line 60 of file script_spell.cpp.

References _C_, SpellActionMissileLocation::AddRandX, SpellActionMissileLocation::AddRandY, SpellActionMissileLocation::AddX, SpellActionMissileLocation::AddY, Assert, SpellActionMissileLocation::Base, LocBaseCaster, LocBaseTarget, LuaError, LuaToNumber(), and LuaToString().

Referenced by CclSpellAction().

void SpellCclRegister ( void   ) 

< register fonction.

Register CCL features for Spell.

Definition at line 753 of file script_spell.cpp.

References CclDefineSpell(), and Lua.

Referenced by InitCcl().


Generated on Sat Feb 21 00:28:18 2009 for Bos Wars by  doxygen 1.5.6