forked from NewEriduPubSec/JaneDoe-ZS
Gacha Model bugfix: post_configure on creating
This commit is contained in:
parent
2041d8dd03
commit
28a3c8d154
2 changed files with 15 additions and 1 deletions
|
@ -7,11 +7,19 @@ use rand::{thread_rng, Rng};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::hash::{BuildHasher, Hash};
|
use std::hash::{BuildHasher, Hash};
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
pub struct GachaModel {
|
pub struct GachaModel {
|
||||||
pub gacha_bin: GachaModelBin,
|
pub gacha_bin: GachaModelBin,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for GachaModel {
|
||||||
|
fn default() -> GachaModel {
|
||||||
|
let result = GachaModel {
|
||||||
|
gacha_bin: GachaModelBin::default(),
|
||||||
|
};
|
||||||
|
result.post_deserialize()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl GachaModel {
|
impl GachaModel {
|
||||||
pub fn from_bin(gacha_bin: GachaModelBin) -> Self {
|
pub fn from_bin(gacha_bin: GachaModelBin) -> Self {
|
||||||
let result = Self { gacha_bin };
|
let result = Self { gacha_bin };
|
||||||
|
|
|
@ -62,6 +62,12 @@ impl Player {
|
||||||
.add_resource(ItemStatic::FrontendGold as u32, 1_000_000);
|
.add_resource(ItemStatic::FrontendGold as u32, 1_000_000);
|
||||||
self.item_model
|
self.item_model
|
||||||
.add_resource(ItemStatic::GameDiamond as u32, 1_000_000);
|
.add_resource(ItemStatic::GameDiamond as u32, 1_000_000);
|
||||||
|
self.item_model
|
||||||
|
.add_resource(ItemStatic::GachaTicketEvent as u32, 30_000);
|
||||||
|
self.item_model
|
||||||
|
.add_resource(ItemStatic::GachaTicketStandard as u32, 30_000);
|
||||||
|
self.item_model
|
||||||
|
.add_resource(ItemStatic::GachaTicketBangboo as u32, 30_000);
|
||||||
self.item_model.add_resource(ItemStatic::Energy as u32, 240);
|
self.item_model.add_resource(ItemStatic::Energy as u32, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue