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 skill::{Skill, Cast, Immunity, Disable, Event};
|
||||||
use effect::{Cooldown, Effect, Colour};
|
use effect::{Cooldown, Effect, Colour};
|
||||||
|
use names::{name};
|
||||||
use spec::{Spec};
|
use spec::{Spec};
|
||||||
use item::{Item};
|
use item::{Item};
|
||||||
use img;
|
use img;
|
||||||
@ -251,6 +252,10 @@ impl Construct {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_name(self) -> Construct {
|
||||||
|
self.named(&name())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn learn(mut self, s: Skill) -> Construct {
|
pub fn learn(mut self, s: Skill) -> Construct {
|
||||||
self.skills.push(ConstructSkill::new(s));
|
self.skills.push(ConstructSkill::new(s));
|
||||||
self.colours = Colours::from_construct(&self);
|
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)?;
|
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 {
|
match mtx.variant {
|
||||||
MtxVariant::Invader => img::invader_write(construct.img)?,
|
MtxVariant::Invader => img::invader_write(construct.img)?,
|
||||||
MtxVariant::Molecular => img::molecular_write(construct.img)?,
|
MtxVariant::Molecular => img::molecular_write(construct.img)?,
|
||||||
MtxVariant::Rename => unimplemented!(),
|
_ => construct.img,
|
||||||
// _ => unimplemented!(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
construct_write(tx, construct)?;
|
construct_write(tx, construct)?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user