rename (random atm)
This commit is contained in:
parent
f94cca9ebc
commit
7081ec8d76
@ -9,6 +9,7 @@ use failure::err_msg;
|
||||
|
||||
use skill::{Skill, Cast, Immunity, Disable, Event};
|
||||
use effect::{Cooldown, Effect, Colour};
|
||||
use names::{name};
|
||||
use spec::{Spec};
|
||||
use item::{Item};
|
||||
use img;
|
||||
@ -251,6 +252,10 @@ impl Construct {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn new_name(self) -> Construct {
|
||||
self.named(&name())
|
||||
}
|
||||
|
||||
pub fn learn(mut self, s: Skill) -> Construct {
|
||||
self.skills.push(ConstructSkill::new(s));
|
||||
self.colours = Colours::from_construct(&self);
|
||||
|
||||
@ -74,12 +74,14 @@ pub fn apply(tx: &mut Transaction, account: &Account, variant: MtxVariant, const
|
||||
|
||||
account::debit(tx, account.id, 1)?;
|
||||
|
||||
construct = construct.new_img();
|
||||
construct = match mtx.variant {
|
||||
MtxVariant::Rename => construct.new_name(),
|
||||
_ => construct.new_img(),
|
||||
};
|
||||
match mtx.variant {
|
||||
MtxVariant::Invader => img::invader_write(construct.img)?,
|
||||
MtxVariant::Molecular => img::molecular_write(construct.img)?,
|
||||
MtxVariant::Rename => unimplemented!(),
|
||||
// _ => unimplemented!(),
|
||||
_ => construct.img,
|
||||
};
|
||||
|
||||
construct_write(tx, construct)?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user