MCPcopy Create free account
hub / github.com/TurningWheel/Barony / createParticleFollowerCommand

Function createParticleFollowerCommand

src/magic/actmagic.cpp:14937–14993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14935}
14936
14937void createParticleFollowerCommand(real_t x, real_t y, real_t z, int sprite, Uint32 uid)
14938{
14939 Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity.
14940 //entity->sizex = 1;
14941 //entity->sizey = 1;
14942 entity->x = x;
14943 entity->y = y;
14944 entity->z = 0;
14945 entity->vel_z = -0.8;
14946 //entity->yaw = (local_rng.rand() % 360) * PI / 180.0;
14947 entity->skill[0] = 50;
14948 entity->skill[1] = 0;
14949 entity->parent = uid;
14950 entity->fskill[1] = entity->z; // start z
14951 entity->behavior = &actParticleFollowerCommand;
14952 entity->scalex = 0.8;
14953 entity->scaley = 0.8;
14954 entity->scalez = 0.8;
14955 entity->flags[PASSABLE] = true;
14956 entity->flags[NOUPDATE] = true;
14957 entity->flags[UNCLICKABLE] = true;
14958 entity->flags[BRIGHT] = true;
14959 if ( multiplayer != CLIENT )
14960 {
14961 entity_uids--;
14962 }
14963 entity->setUID(-3);
14964
14965 // boosty boost
14966 for ( int c = 0; c < 10; c++ )
14967 {
14968 entity = newEntity(174, 1, map.entities, nullptr); //Particle entity.
14969 entity->x = x - 4 + local_rng.rand() % 9;
14970 entity->y = y - 4 + local_rng.rand() % 9;
14971 entity->z = z - 0 + local_rng.rand() % 11;
14972 entity->scalex = 0.5;
14973 entity->scaley = 0.5;
14974 entity->scalez = 0.5;
14975 entity->sizex = 1;
14976 entity->sizey = 1;
14977 entity->yaw = (local_rng.rand() % 360) * PI / 180.f;
14978 entity->flags[PASSABLE] = true;
14979 entity->flags[NOUPDATE] = true;
14980 entity->flags[UNCLICKABLE] = true;
14981 entity->flags[BRIGHT] = true;
14982 entity->lightBonus = vec4(*cvar_magic_fx_light_bonus, *cvar_magic_fx_light_bonus,
14983 *cvar_magic_fx_light_bonus, 0.f);
14984 entity->behavior = &actMagicParticle;
14985 entity->vel_z = -1;
14986 if ( multiplayer != CLIENT )
14987 {
14988 entity_uids--;
14989 }
14990 entity->setUID(-3);
14991 }
14992
14993}
14994

Callers 3

handleActionsMethod · 0.85
actPlayerFunction · 0.85
selectNextFollowerMethod · 0.85

Calls 4

newEntityFunction · 0.85
vec4Class · 0.85
setUIDMethod · 0.80
randMethod · 0.80

Tested by

no test coverage detected