mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Add kirby plants to the random render-pass
This commit is contained in:
parent
f4d2e54a94
commit
ce1c6c3847
1 changed files with 13 additions and 4 deletions
|
|
@ -236,18 +236,27 @@ impl RenderPass for Random {
|
|||
|
||||
const CONTRABAND_POSTERS: u32 = 44;
|
||||
const LEGIT_POSTERS: u32 = 35;
|
||||
let mut rng = ::rand::thread_rng();
|
||||
|
||||
if atom.istype("/obj/structure/sign/poster/contraband/random/") {
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}", ::rand::thread_rng().gen_range(1, 1 + CONTRABAND_POSTERS))));
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}", rng.gen_range(1, 1 + CONTRABAND_POSTERS))));
|
||||
} else if atom.istype("/obj/structure/sign/poster/official/random/") {
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}_legit", ::rand::thread_rng().gen_range(1, 1 + LEGIT_POSTERS))));
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}_legit", rng.gen_range(1, 1 + LEGIT_POSTERS))));
|
||||
} else if atom.istype("/obj/structure/sign/poster/random/") {
|
||||
let i = 1 + ::rand::thread_rng().gen_range(0, CONTRABAND_POSTERS + LEGIT_POSTERS);
|
||||
let i = 1 + rng.gen_range(0, CONTRABAND_POSTERS + LEGIT_POSTERS);
|
||||
if i <= CONTRABAND_POSTERS {
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}", i)));
|
||||
} else {
|
||||
atom.set_var("icon_state", Constant::string(format!("poster{}_legit", i - CONTRABAND_POSTERS)));
|
||||
}
|
||||
} else if atom.istype("/obj/item/twohanded/required/kirbyplants/random/") {
|
||||
atom.set_var("icon", Constant::string("icons/obj/flora/plants.dmi"));
|
||||
let random = rng.gen_range(0, 26);
|
||||
if random == 0 {
|
||||
atom.set_var("icon_state", Constant::string("applebush"));
|
||||
} else {
|
||||
atom.set_var("icon_state", Constant::string(format!("plant-{:02}", random)));
|
||||
}
|
||||
} else if atom.istype("/obj/structure/sign/barsign/") {
|
||||
if let Some(root) = objtree.find("/datum/barsign") {
|
||||
let mut signs = Vec::new();
|
||||
|
|
@ -263,7 +272,7 @@ impl RenderPass for Random {
|
|||
}
|
||||
}
|
||||
}
|
||||
if let Some(c) = ::rand::thread_rng().choose(&signs) {
|
||||
if let Some(c) = rng.choose(&signs) {
|
||||
atom.set_var("icon_state", c.clone());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue