Skip to content

Commit

Permalink
agny
Browse files Browse the repository at this point in the history
  • Loading branch information
MLGTASTICa committed Aug 9, 2024
1 parent 927b2e6 commit 6483577
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
16 changes: 10 additions & 6 deletions code/controllers/subsystems/bullets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define MAXPIXELS 16
SUBSYSTEM_DEF(bullets)
name = "Bullets"
wait = 1
wait = 5
priority = SS_PRIORITY_BULLETS
init_order = INIT_ORDER_BULLETS

Expand Down Expand Up @@ -323,6 +323,8 @@ SUBSYSTEM_DEF(bullets)
currentY = dataReference.globalY
currentZ = dataReference.globalZ



if(canContinue != PROJECTILE_CONTINUE)
var/a = round((currentX+stepX)/32)
var/b = round((currentY+stepY)/32)
Expand All @@ -332,17 +334,19 @@ SUBSYSTEM_DEF(bullets)
special.forceMove(turfer)
special.icon = projectile.icon
special.icon_state = projectile.icon_state
special.pixel_x = round((currentX+stepX))%32
special.pixel_y = round((currentY+stepY))%32
special.pixel_x = round((currentX+stepX))%32 - 16
special.pixel_y = round((currentY+stepY))%32 - 16
special.transform = projectile.transform
message_admins("started at X: [round(currentX)]. Y: [round(currentY)] , stopping at X: [round(currentX+stepX)] , Y:[round(currentY+stepY)]")
dataReference.globalX += stepX
dataReference.globalY += stepY
dataReference.globalX = currentX + stepX
dataReference.globalY = currentY + stepY
dataReference.globalZ += stepZ
dataReference.lifetime = 0
break

animate(projectile, SSbullets.wait, pixel_x = dataReference.globalX%PPT - 16, pixel_y = dataReference.globalY%PPT - 16, flags = ANIMATION_END_NOW)
if(canContinue != PROJECTILE_CONTINUE)
message_admins("globalX : [dataReference.globalX] globalY: [dataReference.globalY]")
animate(projectile, SSbullets.wait, pixel_x = dataReference.globalX%PPT - HPPT, pixel_y = dataReference.globalY%PPT - HPPT, flags = ANIMATION_END_NOW)
if(dataReference.lifetime < 1)
projectile.finishDeletion()
bullet_queue.Remove(dataReference)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/projectiles/hitbox_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
secondRatio = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator
if(firstRatio >= 0 && firstRatio <= 1 && secondRatio >= 0 && secondRatio <= 1)
/// Distance to intersection of point
*pStepX = firstRatio * (x2 - x1)
*pStepY = firstRatio * (y2 - y1)
message_admins("pstepX = [*pStepX] , pstepY = [*pStepY]")
*pStepX = firstRatio * (x2 - x1) - *pStepX
*pStepY = firstRatio * (y2 - y1) - *pStepY
message_admins("Collision put at X:[x1 + *pStepX] Y:[y1+ *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
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ GLOBAL_LIST(projectileDamageConstants)
visEffect.transform = src.transform
visEffect.update_plane()

QDEL_IN(src, 2)
QDEL_IN(src, SSbullets.wait * 5)

/obj/item/projectile/explosion_act(target_power, explosion_handler/handler)
return 0
Expand Down

0 comments on commit 6483577

Please sign in to comment.