____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#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 SpellActionType * | CclSpellAction (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. | |
Definition in file script_spell.cpp.
| char Ccl2Condition | ( | lua_State * | l, | |
| const char * | value | |||
| ) |
Get a condition value from a scm object.
| l | Lua state. | |
| value | scm value to convert. |
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] |
Parse Spell.
| l | Lua state. |
Definition at line 636 of file script_spell.cpp.
References _C_, SpellType::Action, SpellType::AICast, SpellType::AutoCast, CanCastSpell(), CclSpellAction(), CclSpellAutocast(), CclSpellCondition(), SpellType::Condition, DebugPrint, INFINITE_RANGE, LuaError, LuaToNumber(), LuaToString(), SpellType::ManaCost, SoundConfig::Name, SpellType::Name, SpellType::Range, SpellType::RepeatCast, SoundConfig::Sound, SoundForName(), SpellType::SoundWhenCast, SpellTypeByIdent(), SpellTypeTable, SpellType::Target, TargetPosition, TargetSelf, TargetUnit, and UnitTypes.
Referenced by SpellCclRegister().
| static SpellActionType* CclSpellAction | ( | lua_State * | l | ) | [static] |
Parse the action for spell.
| 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.
| l | Lua state. | |
| autocast | pointer to autocast to fill with data. |
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] |
Parse the Condition for spell.
| l | Lua state. | |
| condition | pointer to condition to fill with data. |
Definition at line 499 of file script_spell.cpp.
References _C_, ConditionInfo::Alliance, ConditionInfo::Building, Ccl2Condition(), ConditionInfoVariable::ConditionApplyOnCaster, ConditionInfoVariable::Enable, GetVariableIndex(), LuaError, LuaToBoolean(), LuaToNumber(), LuaToString(), ConditionInfoVariable::MaxValue, ConditionInfoVariable::MaxValuePercent, ConditionInfoVariable::MinMax, ConditionInfoVariable::MinValue, ConditionInfoVariable::MinValuePercent, CUnitTypeVar::NumberVariable, ConditionInfo::Opponent, ConditionInfo::Organic, ConditionInfo::TargetSelf, UnitTypeVar, and ConditionInfo::Variable.
Referenced by CclDefineSpell(), and CclSpellAutocast().
| static void CclSpellMissileLocation | ( | lua_State * | l, | |
| SpellActionMissileLocation * | location | |||
| ) | [static] |
Parse the missile location description for a spell action.
| l | Lua state. | |
| location | Pointer to missile location description. |
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().
1.5.6