Merge branch 'sarrakitty/fireworks' into 'master'

added a white firework

See merge request veloren/veloren!1856
This commit is contained in:
Marcel 2021-03-07 18:37:35 +00:00
commit e29964ead1
11 changed files with 92 additions and 35 deletions

View File

@ -0,0 +1,9 @@
ItemDef(
name: "Firework White",
description: "Twinkles like the stars",
kind: Throwable(
kind: Firework(White),
),
quality: Moderate,
tags: [],
)

View File

@ -100,6 +100,16 @@
(Item("common.items.crafting_tools.mortar_pestle"), 0),
],
),
"firework_white": (
("common.items.utility.firework_white", 1),
[
(Item("common.items.crafting_ing.twigs"), 1),
(Item("common.items.crafting_ing.stones"), 1),
(Item("common.items.food.coconut"), 1),
(Item("common.items.ore.veloritefrag"), 1),
(Item("common.items.crafting_tools.mortar_pestle"), 0),
],
),
"firework_yellow": (
("common.items.utility.firework_yellow", 1),
[

View File

@ -1796,6 +1796,10 @@
"voxel.weapon.projectile.fireworks_red-0",
(0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8,
),
Throwable(Firework(White)): VoxTrans(
"voxel.weapon.projectile.fireworks_white-0",
(0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8,
),
Throwable(Firework(Yellow)): VoxTrans(
"voxel.weapon.projectile.fireworks_yellow-0",
(0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8,

View File

@ -46,19 +46,20 @@ const int FIREWORK_BLUE = 4;
const int FIREWORK_GREEN = 5;
const int FIREWORK_PURPLE = 6;
const int FIREWORK_RED = 7;
const int FIREWORK_YELLOW = 8;
const int LEAF = 9;
const int FIREFLY = 10;
const int BEE = 11;
const int GROUND_SHOCKWAVE = 12;
const int HEALING_BEAM = 13;
const int ENERGY_NATURE = 14;
const int FLAMETHROWER = 15;
const int FIRE_SHOCKWAVE = 16;
const int FIRE_BOWL = 17;
const int SNOW = 18;
const int EXPLOSION = 19;
const int ICE = 20;
const int FIREWORK_WHITE = 8;
const int FIREWORK_YELLOW = 9;
const int LEAF = 10;
const int FIREFLY = 11;
const int BEE = 12;
const int GROUND_SHOCKWAVE = 13;
const int HEALING_BEAM = 14;
const int ENERGY_NATURE = 15;
const int FLAMETHROWER = 16;
const int FIRE_SHOCKWAVE = 17;
const int FIRE_BOWL = 18;
const int SNOW = 19;
const int EXPLOSION = 20;
const int ICE = 21;
// meters per second squared (acceleration)
const float earth_gravity = 9.807;
@ -257,6 +258,17 @@ void main() {
vec4(vec3(2, 0, 0), 1),
identity()
);
} else if (inst_mode == FIREWORK_WHITE) {
f_reflect = 0.0; // Fire doesn't reflect light, it emits it
attr = Attr(
linear_motion(
vec3(0),
normalize(vec3(rand1, rand2, rand3)) * 40.0 + grav_vel(earth_gravity)
),
vec3(3.0 + rand0),
vec4(vec3(2, 2, 2), 1),
identity()
);
} else if (inst_mode == FIREWORK_YELLOW) {
f_reflect = 0.0; // Fire doesn't reflect light, it emits it
attr = Attr(

View File

@ -59,6 +59,16 @@
central: ("armor.empty"),
)
),
FireworkWhite: (
bone0: (
offset: (0.0, 0.0, 0.0),
central: ("weapon.projectile.fireworks_white-0"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
FireworkYellow: (
bone0: (
offset: (0.0, 0.0, 0.0),

BIN
assets/voxygen/voxel/weapon/projectile/fireworks_white-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -65,14 +65,15 @@ make_case_elim!(
FireworkGreen = 55,
FireworkPurple = 56,
FireworkRed = 57,
FireworkYellow = 58,
MultiArrow = 59,
BoltNature = 60,
MeatDrop = 61,
Steak = 62,
Crossbow = 63,
ArrowTurret = 64,
Coins = 65,
FireworkWhite = 58,
FireworkYellow = 59,
MultiArrow = 60,
BoltNature = 61,
MeatDrop = 62,
Steak = 63,
Crossbow = 64,
ArrowTurret = 65,
Coins = 66,
}
);
@ -83,7 +84,7 @@ impl Body {
}
}
pub const ALL_OBJECTS: [Body; 66] = [
pub const ALL_OBJECTS: [Body; 67] = [
Body::Arrow,
Body::Bomb,
Body::Scarecrow,
@ -142,6 +143,7 @@ pub const ALL_OBJECTS: [Body; 66] = [
Body::FireworkGreen,
Body::FireworkPurple,
Body::FireworkRed,
Body::FireworkWhite,
Body::FireworkYellow,
Body::MultiArrow,
Body::BoltNature,
@ -217,6 +219,7 @@ impl Body {
Body::FireworkGreen => "firework_green",
Body::FireworkPurple => "firework_purple",
Body::FireworkRed => "firework_red",
Body::FireworkWhite => "firework_white",
Body::FireworkYellow => "firework_yellow",
Body::MultiArrow => "multi_arrow",
Body::BoltNature => "bolt_nature",
@ -234,6 +237,7 @@ impl Body {
Reagent::Green => Body::FireworkGreen,
Reagent::Purple => Body::FireworkPurple,
Reagent::Red => Body::FireworkRed,
Reagent::White => Body::FireworkWhite,
Reagent::Yellow => Body::FireworkYellow,
}
}

View File

@ -42,6 +42,7 @@ pub enum Reagent {
Green,
Purple,
Red,
White,
Yellow,
}

View File

@ -104,19 +104,20 @@ pub enum ParticleMode {
FireworkGreen = 5,
FireworkPurple = 6,
FireworkRed = 7,
FireworkYellow = 8,
Leaf = 9,
Firefly = 10,
Bee = 11,
GroundShockwave = 12,
HealingBeam = 13,
EnergyNature = 14,
FlameThrower = 15,
FireShockwave = 16,
FireBowl = 17,
Snow = 18,
Explosion = 19,
Ice = 20,
FireworkWhite = 8,
FireworkYellow = 9,
Leaf = 10,
Firefly = 11,
Bee = 12,
GroundShockwave = 13,
HealingBeam = 14,
EnergyNature = 15,
FlameThrower = 16,
FireShockwave = 17,
FireBowl = 18,
Snow = 19,
Explosion = 20,
Ice = 21,
}
impl ParticleMode {

View File

@ -423,6 +423,7 @@ impl Scene {
Rgb::new(1.0, 0.0, 0.0)
}
},
Some(Reagent::White) => Rgb::new(1.0, 1.0, 1.0),
Some(Reagent::Yellow) => Rgb::new(1.0, 1.0, 0.0),
None => Rgb::new(1.0, 0.5, 0.0),
},

View File

@ -128,6 +128,7 @@ impl ParticleMgr {
Some(Reagent::Green) => ParticleMode::FireworkGreen,
Some(Reagent::Purple) => ParticleMode::FireworkPurple,
Some(Reagent::Red) => ParticleMode::FireworkRed,
Some(Reagent::White) => ParticleMode::FireworkWhite,
Some(Reagent::Yellow) => ParticleMode::FireworkYellow,
None => ParticleMode::Shrapnel,
},
@ -217,6 +218,7 @@ impl ParticleMgr {
| object::Body::FireworkGreen
| object::Body::FireworkPurple
| object::Body::FireworkRed
| object::Body::FireworkWhite
| object::Body::FireworkYellow,
) => self.maintain_bomb_particles(scene_data, pos),
_ => {},