the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 93 lines 1.7 kB view raw
1#include "stdafx.h" 2#include "CritParticle2.h" 3#include "..\Minecraft.World\JavaMath.h" 4 5void CritParticle2::_init(double xa, double ya, double za, float scale) 6{ 7 xd *= 0.1f; 8 yd *= 0.1f; 9 zd *= 0.1f; 10 xd += xa * 0.4; 11 yd += ya * 0.4; 12 zd += za * 0.4; 13 14 rCol = gCol = bCol = (float) (Math::random() * 0.3f + 0.6f); 15 size *= 0.75f; 16 size *= scale; 17 oSize = size; 18 19 lifetime = (int) (6 / (Math::random() * 0.8 + 0.6)); 20 lifetime *= scale; 21 noPhysics = false; 22 23 setMiscTex(16 * 4 + 1); 24 // 4J-PB - can't use a shared_from_this in the constructor 25 //tick(); 26 m_bAgeUniformly=false; // 4J added 27} 28 29CritParticle2::CritParticle2(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, 0, 0, 0) 30{ 31 _init(xa,ya,za,1); 32} 33 34CritParticle2::CritParticle2(Level *level, double x, double y, double z, double xa, double ya, double za, float scale) : Particle(level, x, y, z, 0, 0, 0) 35{ 36 _init(xa,ya,za,scale); 37} 38 39void CritParticle2::CritParticle2PostConstructor(void) 40{ 41 tick(); 42} 43 44void CritParticle2::render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2) 45{ 46 float l = ((age + a) / lifetime) * 32; 47 if (l < 0) l = 0; 48 if (l > 1) l = 1; 49 50 size = oSize * l; 51 Particle::render(t, a, xa, ya, za, xa2, za2); 52} 53 54void CritParticle2::SetAgeUniformly() 55{ 56 m_bAgeUniformly=true; 57} 58 59void CritParticle2::tick() 60{ 61 xo = x; 62 yo = y; 63 zo = z; 64 65 if (age++ >= lifetime) remove(); 66 67 move(xd, yd, zd); 68 gCol *= 0.96; 69 bCol *= 0.9; 70 71 if(m_bAgeUniformly) 72 { 73 rCol *= 0.99; 74 gCol *= 0.99; 75 bCol *= 0.99; 76 } 77 else 78 { 79 gCol *= 0.96; 80 bCol *= 0.9; 81 } 82 83 xd *= 0.70f; 84 yd *= 0.70f; 85 zd *= 0.70f; 86 yd-=0.02f; 87 88 if (onGround) 89 { 90 xd *= 0.7f; 91 zd *= 0.7f; 92 } 93}