Skip to content

Commit

Permalink
THIS NAMING MISTAKE COST ME 4 HOURS I FUCKINGU AHWUAUFHAFA
Browse files Browse the repository at this point in the history
  • Loading branch information
MLGTASTICa committed Aug 11, 2024
1 parent 429fe4a commit 53d2424
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
9 changes: 6 additions & 3 deletions code/controllers/subsystems/bullets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// it is also more inaccurate the higher you go..
#define MAXPIXELS 16
/// Define this / uncomment it if you want to see bullet debugging data for trajectories & chosen paths.
#define BULLETDEBUG 1
//#define BULLETDEBUG 1
SUBSYSTEM_DEF(bullets)
name = "Bullets"
wait = 1
Expand Down Expand Up @@ -150,7 +150,7 @@ SUBSYSTEM_DEF(bullets)
stepY = dataReference.ratioY * pixelStep
stepZ = LERP(dataReference.originalZ, dataReference.targetZ, dataReference.traveledPixels/dataReference.distanceToTarget) - dataReference.globalZ
currentTurf = get_turf(projectile)
message_admins("Z : [dataReference.globalZ] with step [stepZ] , Ratio : [dataReference.traveledPixels/dataReference.distanceToTarget]")
//message_admins("Z : [dataReference.globalZ] with step [stepZ] , Ratio : [dataReference.traveledPixels/dataReference.distanceToTarget]")
movementTurf = locate(round((currentX+stepX)/PPT),round((currentY+stepY)/PPT),round((currentZ+stepZ)/PPT))
if(!movementTurf)
dataReference.lifetime = 0
Expand Down Expand Up @@ -242,21 +242,24 @@ SUBSYSTEM_DEF(bullets)
currentZ = dataReference.globalZ

var/bulletTime = SSbullets.wait *(dataReference.pixelSpeed / (dataReference.pixelSpeed + pixelTotal))
/*
if(canContinue != PROJECTILE_CONTINUE)
var/a = round((stepX)/32)
var/b = round((stepY)/32)
var/c = round(currentZ/32)
var/turf/turfer = locate(a,b,c)
var/atom/movable/special = new /obj/item()
message_admins("stepX:[stepX] , stepY : [stepY]")
message_admins("MovTurf ----- X: [movementTurf.x] Y:[movementTurf.y] Z:[movementTurf.z]")
if(movementTurf)
message_admins("MovTurf ----- X: [movementTurf.x] Y:[movementTurf.y] Z:[movementTurf.z]")
message_admins("VisTurf ----- X: [a] Y:[b] Z:[c]")
special.forceMove(turfer)
special.icon = projectile.icon
special.icon_state = projectile.icon_state
special.pixel_x = round((stepX))%32 - 16
special.pixel_y = round((stepY))%32 - 16
special.transform = projectile.transform
*/


animate(projectile, bulletTime, pixel_x = dataReference.globalX%PPT - HPPT, pixel_y = dataReference.globalY%PPT - HPPT, flags = ANIMATION_END_NOW)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ GLOBAL_LIST(melleDamagesCache)
//For non-projectile attacks this usually means the attack is blocked.
//Otherwise should return 0 to indicate that the attack is not affected in any way.
/obj/item/proc/handle_shield(mob/user, damage, atom/damage_source = null, mob/attacker = null, def_zone = null, attack_text = "the attack")
return 0
return PROJECTILE_CONTINUE

/obj/item/proc/get_loc_turf()
var/atom/L = loc
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ meteor_act
return shield_check
else
P.on_hit(src, def_zone)
return 2
return PROJECTILE_STOP

//Checking absorb for spawning shrapnel
.=..(P , def_zone)
Expand All @@ -56,6 +56,8 @@ meteor_act
return PROJECTILE_CONTINUE
else
return PROJECTILE_STOP
return PROJECTILE_STOP




Expand Down
17 changes: 9 additions & 8 deletions code/modules/projectiles/hitbox_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
if(firstRatio >= 0 && firstRatio <= 1 && secondRatio >= 0 && secondRatio <= 1)
*pStepX = x1 + firstRatio * (x2 - x1)
*pStepY = y1 + firstRatio * (y2 - y1)
message_admins("set x to [*pStepX] , set y to [*pStepY]")
return TRUE
//return list(x1 + firstRatio * (x2 - x1), y1 + firstRatio * (y2 - y1))
//message_admins("X-collision : [x1 + firstRatio * (x2 - x1)] Y-collision : [y1 + firstRatio * (y2] - y1)]")
Expand Down Expand Up @@ -268,13 +269,13 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
continue
if((boundingData[5]+worldZ) < min(startZ,startZ+*pStepZ) && (boundingData[6]+worldZ) < min(startZ,startZ+*pStepZ))
continue
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[1] + worldX, boundingData[4] + worldY))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[1] + worldX, boundingData[4] + worldY, pStepX, pStepY))
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[2] + worldY))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[2] + worldY, pStepX, pStepY))
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[4] + worldY, boundingData[3] + worldX, boundingData[4] + worldY))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[4] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepX, pStepY))
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[3] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[4] + worldY))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[3] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepX, pStepY))
return TRUE
return FALSE

Expand Down Expand Up @@ -577,16 +578,16 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
continue
if((boundingData[5]+worldZ) < min(startZ,startZ+*pStepZ) && (boundingData[6]+worldZ) < min(startZ,startZ+*pStepZ))
continue
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[1] + worldX, boundingData[4] + worldY, pStepY, pStepZ))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[1] + worldX, boundingData[4] + worldY, pStepX, pStepY))
*pHitFlags = boundingData[7]
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[2] + worldY, pStepY, pStepZ))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[2] + worldY, pStepX, pStepY))
*pHitFlags = boundingData[7]
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[4] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepY, pStepZ))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[1] + worldX, boundingData[4] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepX, pStepY))
*pHitFlags = boundingData[7]
return TRUE
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[3] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepY, pStepZ))
if(lineIntersect(startX, startY, startX+*pStepX, startY+*pStepY, boundingData[3] + worldX, boundingData[2] + worldY, boundingData[3] + worldX, boundingData[4] + worldY, pStepX, pStepY))
*pHitFlags = boundingData[7]
return TRUE
return FALSE
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ GLOBAL_LIST(projectileDamageConstants)
/obj/item/projectile/proc/attack_mob(mob/living/target_mob, miss_modifier=0)
if(!istype(target_mob))
return
message_admins("Called attack mob")

//roll to-hit
miss_modifier = 0
Expand Down

0 comments on commit 53d2424

Please sign in to comment.