Adds effects for changing target stats.
This commit is contained in:
@@ -35,6 +35,35 @@ impl EffectParameter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_bool(&self) -> bool {
|
||||
if let EffectParameter::Bool(b) = self {
|
||||
return *b;
|
||||
}
|
||||
panic!("Unexpected effect parameter type: {}", self);
|
||||
}
|
||||
|
||||
pub fn as_int(&self) -> i64 {
|
||||
if let EffectParameter::Int(i) = self {
|
||||
return *i;
|
||||
}
|
||||
panic!("Unexpected effect parameter type: {}", self);
|
||||
}
|
||||
|
||||
pub fn as_float(&self) -> f32 {
|
||||
if let EffectParameter::Float(f) = self {
|
||||
return *f;
|
||||
}
|
||||
panic!("Unexpected effect parameter type: {}", self);
|
||||
}
|
||||
|
||||
pub fn as_string(&self) -> StringKey {
|
||||
if let EffectParameter::String(s) = self {
|
||||
return s.clone();
|
||||
}
|
||||
panic!("Unexpected effect parameter type: {}", self);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "mock_data"))]
|
||||
|
||||
Reference in New Issue
Block a user