[−][src]Struct sulis_state::script::ScriptEffect
An effect, normally created via ScriptEntity:create_effect.
The effect is then configured and then apply() is called.
apply()
Sets this effect to active on the parent entity.
set_icon(icon: String, text: String)
Sets the specified icon and text as the icon data for this effect. This icon is displayed in various places in the UI.
set_squares_to_fire_on_moved(squares: Int)
Only has an effect on surfaces. Sets the number of squares that an entity
must move within a surface in order to trigger an OnMovedInSurface script
event.
set_aura(aura_parent: ScriptEntity)
Only has an effect on surfaces. Sets whether this effect is an aura. Auras are surfaces that move along with the parent.
add_image_layer_anim(anim: ScriptImageLayerAnimation)
Adds the specified anim to this effect. The anim will have apply() called
when this effect has apply() called. It will be removed when this effect is
removed.
add_color_anim(anim: ScriptColorAnimation)
Adds the specified anim to this effect. The anim will have apply() called
when this effect has apply() called. It will be removed when this effect is
removed.
add_scale_anim(anim: ScriptScaleAnimation)
Adds the specified anim to this effect. The anim will have apply() called when
this effect has apply() called. It will be removed when this effect is
removed.
add_anim(anim: ScriptParticleGenerator)
Adds the specified anim to this effect. The anim will have apply() called
when this effect has apply() called. It will be removed when this effect is
removed.
add_subpos_anim(anim: ScriptSubposAnimation)
Adds a subpos animation anim to this effect. The anim will have apply()
called when this effect has apply() called. It will be removed when this
effect is removed.
add_callback(callback: CallbackData)
Adds the specified callback to fire for entity's with this effect.
deactivate_with(ability: ScriptAbility)
Sets this effect to be removed whenever the specified ability is deactivated.
The ability must be a mode.
set_ui_visible(visible: Boolean)
Sets whether this effect will show up in the UI listing of effects. The default is true.
set_tag(tag: String)
Sets a tag to identify this effect as being of a particular type to other scripts.
Most notably, this is used when calling remove_effects_with_tag on a ScriptEntity
add_num_bonus(kind: String, amount: Float, when: String (Optional))
Adds a numeric bonus that is applied to the parent entity when this effect is active.
Positive values are bonuses, while negative values are penalties. when is optional
and specifies a condition that must be met for the bonus to be active. By default,
the bonus is always applied. Valid values are always, attack_when_hidden,
attack_when_flanking, weapon_equipped <WEAPON_KIND>,
armor_equipped <ARMOR_KIND> <INVENTORY_SLOT>, weapon_style <WEAPON_STYLE>,
attack_with_weapon <WEAPON_KIND>, attack_with_damage_kind <DAMAGE_KIND>
Bonus kinds include armor, ap, reach, range, initiative, hit_points,
melee_accuracy, ranged_accuracy, spell_accuracy, defense, fortitude,
reflex, will, concealment, concealment_ignore, crit_chance,
hit_threshold, graze_threshold, graze_multiplier, hit_multiplier,
crit_multiplier, movement_rate, move_anim_rate, attack_cost, ability_ap_cost,
caster_level, flanking_angle
add_damage(min: Float, max: Float, ap: Float (Optional), when: String (Optional))
Adds a damage bonus of the specified amount (from min to max randomly, with ap
armor piercing). See add_num_bonus
add_hidden(when: String (Optional))
Adds the hidden status to this effect. See add_num_bonus
add_free_ability_group_use(when: String(Optional))
Abbs ability use not using up group uses per encounter/day to this effect. See add_num_bonus
add_abilities_disabled(when: String (Optional))
Adds ability-use disabled status to this effect. See add_num_bonus
add_move_disabled(when: String (Optional))
Adds the move disabled status to this effect. See add_num_bonus
add_attack_disabled(when: String (Optional))
Adds the attack disabled status to this effect. See add_num_bonus
add_flanked_immunity(when: String (Optional))
Adds immunity to flanking to this effect. See add_num_bonus
add_sneak_attack_immunity(when: String (Optional))
Adds immunity to sneak attack to this effect. See add_num_bonus
add_crit_immunity(when: String (Optional))
Adds immunity to crits to this effect (all crits become hits). See add_num_bonus
`add_damage_of_kind(min: Float, max: Float, kind: String, ap: String (Optional),
when: String (Optional))Adds the specified amount (frommintomaxrandomly, withaparmor piercing) of damage of the specifiedkindto this effect. Seeadd_num_bonus`
add_armor_of_kind(value: Float, kind: String, when: String (Optional))
Adds an armor bonus of the specified value and kind to this effect. See
add_num_bonus
add_resistance(value: Float, kind: String, when: String (Optional))
Adds a percentage damage resistance of value against kind damage
as a bonus to this effect. See add_num_bonus
add_attribute_bonus(attr: String, amount: Float, when: String (Optional))
Adds an attribute bonus for attr of amount to this effect. Valid attributes
are Strength, Dexterity, Endurance, Perception, Intellect, and Wisdom
Fields
bonuses: BonusListImplementations
impl ScriptEffect[src]
pub fn new_surface(
points: Vec<(i32, i32)>,
name: &str,
duration: ExtInt
) -> ScriptEffect[src]
points: Vec<(i32, i32)>,
name: &str,
duration: ExtInt
) -> ScriptEffect
pub fn new_entity(parent: usize, name: &str, duration: ExtInt) -> ScriptEffect[src]
Trait Implementations
impl Clone for ScriptEffect[src]
fn clone(&self) -> ScriptEffect[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl UserData for ScriptEffect[src]
fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)[src]
Auto Trait Implementations
impl RefUnwindSafe for ScriptEffect
impl Send for ScriptEffect
impl Sync for ScriptEffect
impl Unpin for ScriptEffect
impl UnwindSafe for ScriptEffect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<'lua, T> FromLua<'lua> for T where
T: 'static + UserData + Clone, [src]
T: 'static + UserData + Clone,
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>, [src]
T: FromLua<'lua>,
pub fn from_lua_multi(
values: MultiValue<'lua>,
lua: Context<'lua>
) -> Result<T, Error>[src]
values: MultiValue<'lua>,
lua: Context<'lua>
) -> Result<T, Error>
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<'lua, T> ToLua<'lua> for T where
T: 'static + UserData + Send, [src]
T: 'static + UserData + Send,
impl<'lua, T> ToLuaMulti<'lua> for T where
T: ToLua<'lua>, [src]
T: ToLua<'lua>,
pub fn to_lua_multi(self, lua: Context<'lua>) -> Result<MultiValue<'lua>, Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,