Differences From Artifact [6b111961c9]:
- File src/weapon.m — part of check-in [e8f80b0482] at 2025-03-23 02:03:32 on branch trunk — Convert monster into a class (user: js, size: 10051) [annotate] [blame] [check-ins using]
To Artifact [acb2ec57ac]:
- File
src/weapon.m
— part of check-in
[6b85eefc85]
at
2025-03-23 02:47:40
on branch trunk
— Remove loop[ijkl]
They confused clang-format a lot. (user: js, size: 10129) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
73 74 75 76 77 78 79 | // create random spread of rays for the shotgun void createrays(const OFVector3D *from, const OFVector3D *to) { vdist(dist, dvec, *from, *to); float f = dist * SGSPREAD / 1000; | | < | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | // create random spread of rays for the shotgun void createrays(const OFVector3D *from, const OFVector3D *to) { vdist(dist, dvec, *from, *to); float f = dist * SGSPREAD / 1000; for (int i = 0; i < SGRAYS; i++) { #define RNDD (rnd(101) - 50) * f OFVector3D r = OFMakeVector3D(RNDD, RNDD, RNDD); sg[i] = *to; vadd(sg[i], r); } } |
︙ | ︙ | |||
164 165 166 167 168 169 170 | p.local = local; p.owner = owner; p.gun = gun; return; } } | | | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | p.local = local; p.owner = owner; p.gun = gun; return; } } static void hit(int target, int damage, __kindof DynamicEntity *d, DynamicEntity *at) { OFVector3D o = d.origin; if (d == player1) selfdamage(damage, at == player1 ? -1 : -2, at); else if ([d isKindOfClass:Monster.class]) [d incurDamage:damage fromEntity:at]; |
︙ | ︙ | |||
201 202 203 204 205 206 207 | int damage = (int)(qdam * (1 - (dist / RL_DAMRAD))); hit(cn, damage, o, at); vmul(temp, (RL_DAMRAD - dist) * damage / 800); vadd(o.velocity, temp); } } | | | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | int damage = (int)(qdam * (1 - (dist / RL_DAMRAD))); hit(cn, damage, o, at); vmul(temp, (RL_DAMRAD - dist) * damage / 800); vadd(o.velocity, temp); } } static void splash(Projectile *p, const OFVector3D *v, const OFVector3D *vold, int notthisplayer, int notthismonster, int qdam) { particle_splash(0, 50, 300, v); p.inuse = false; if (p.gun != GUN_RL) { |
︙ | ︙ | |||
318 319 320 321 322 323 324 | playsound(guns[gun].sound, d == player1 ? NULL : &loc); int pspeed = 25; switch (gun) { case GUN_FIST: break; case GUN_SG: { | > | | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | playsound(guns[gun].sound, d == player1 ? NULL : &loc); int pspeed = 25; switch (gun) { case GUN_FIST: break; case GUN_SG: { for (int i = 0; i < SGRAYS; i++) particle_splash(0, 5, 200, &sg[i]); break; } case GUN_CG: particle_splash(0, 100, 250, to); // particle_trail(1, 10, from, to); break; |
︙ | ︙ | |||
367 368 369 370 371 372 373 | int qdam = guns[d.gunSelect].damage; if (d.quadMillis) qdam *= 4; if ([d isKindOfClass:Monster.class]) qdam /= MONSTERDAMAGEFACTOR; if (d.gunSelect == GUN_SG) { int damage = 0; | > | > | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | int qdam = guns[d.gunSelect].damage; if (d.quadMillis) qdam *= 4; if ([d isKindOfClass:Monster.class]) qdam /= MONSTERDAMAGEFACTOR; if (d.gunSelect == GUN_SG) { int damage = 0; for (int r = 0; r < SGRAYS; r++) if (intersect(o, from, &sg[r])) damage += qdam; if (damage) hitpush(i, damage, o, d, from, to); } else if (intersect(o, from, to)) hitpush(i, qdam, o, d, from, to); } void |
︙ | ︙ |