From: xolatile Date: Sun, 20 Jul 2025 23:42:12 +0000 (+0200) Subject: Auto, custom map menu, weapon effects... X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=39de2c68c8a3f9cd7cffef9364a59c9d412b907e;p=xolatile-badassbug.git Auto, custom map menu, weapon effects... --- diff --git a/autoexec.cfg b/autoexec.cfg new file mode 100755 index 0000000..9800f58 --- /dev/null +++ b/autoexec.cfg @@ -0,0 +1,27 @@ +// Example configuration file, my personal bindings - Xolatile. +// This file will be executed every time the game is ran. + +exec custommapsmenu.cfg // Wide custom maps menu. + +bind e [setweapon 1] // Shotgun. +bind q [setweapon 2] // Chaingun. +bind LCTRL [setweapon 3] // Rocket launcher. +bind r [setweapon 4] // Rifle. +bind LALT [setweapon 5] // Grenade launcher. +bind f [setweapon 6] // Pistol. +bind LSHIFT [setweapon 0] // Chainsaw. + +bind m [showcustommaps] // Unofficial custom maps. +bind n [showgui maps] // Official maps. + +editbind SPACE [floatspeed 1200; onrelease [floatspeed 120]] // Float fast in edit mode when space is held. +editbind LALT [history 0] // Repeat last executed command in edit mode. + +// bind MOUSE2 [togglezoom] // Commented it out, I don't use 2 binds below, it's just an example. + +bind MOUSE2 [setweapon 5; attack 1; onrelease weapon] // Shoot quick rocket on right button. +bind MOUSE3 [setweapon 5; attack 1; onrelease weapon] // Shoot quick grenade on middle button. + +hudscore 1 // Show HUD score. +ammobar 1 // Show HUD ammo bar. +gameclock 1 // Show HUD game clock. diff --git a/custommapsmenu.cfg b/custommapsmenu.cfg new file mode 100755 index 0000000..cac660a --- /dev/null +++ b/custommapsmenu.cfg @@ -0,0 +1,71 @@ +// Custom map menu, ported from Sauerbraten, 7Year aka Xolatile. + +octabase = "^f7" +octamain = "^f1" +unmapsx = 4 +unmapsy = 24 + +custommaps = "" + +loopfiles curmap "packages/maps" "ogz" [ + if (< (indexof $allmaps $curmap) 0) [ + custommaps = (concat $custommaps $curmap) + ] +] + +sy_nume = (listlen $custommaps) + +showcustommaps = [sy_remaps; showgui sy_unmaps] + +sy_remaps = [ + custommaps = "" + loopfiles curmap "packages/maps" "ogz" [ + if (< (indexof $allmaps $curmap) 0) [ + custommaps = (concat $custommaps $curmap) + ] + ] + custommaps = (sortlist $custommaps x y [<=s $x $y]) + amountxy = (+ (div (listlen $custommaps) $unmapsy) 1) + loop syxy $amountxy [ + (concatword "custommaps" $syxy) = "" + ]; syxy = 0 + loop syxy $amountxy [ + (concatword "custommaps" $syxy) + loop unto $unmapsy [ + (concatword "custommaps" $syxy) = (concat $(concatword "custommaps" $syxy) (at $custommaps (+ (* $unmapsy $syxy) $unto))) + ] + ]; syxy = 0; unto = 0 + sy_nume = (listlen $custommaps) +] + +newgui sy_unmaps [ + if (mod $amountxy $unmapsx) [ + sy_unpage = (+ (div $amountxy $unmapsx) 1) + ] [ + sy_unpage = (div $amountxy $unmapsx) + ] + loop syi $sy_unpage [ + guilist [ + loop syj $unmapsx [ + if (< (+ (* $syi $unmapsx) $syj) $amountxy) [ + guistrut $unmapsy 1 + guilist [ + guistrut 27 1 + looplist unto $(concatword "custommaps" (+ (* $syi $unmapsx) $syj )) [ + guibutton (concatword $octabase $unto) (concat map $unto) "cube" + ] + ] + ] + ] + guibar + if (< (+ (* $syi $unmapsx) $syj) $amountxy) [ + guiimage (concatword "packages/maps/" (strreplace $guirolloveraction "map " "") ".jpg") $guirolloveraction 6 1 "data/cube.png" + ] + ] + if (= (+ $syi 1) $sy_unpage) [ + + ] [ + guitab (concatword $octamain (+ $syi 2)) + ] + ] +] (concatword $octamain "Custom Maps (" $sy_nume ")") diff --git a/src/fpsgame/weapon.cpp b/src/fpsgame/weapon.cpp index b062609..ab87ebf 100644 --- a/src/fpsgame/weapon.cpp +++ b/src/fpsgame/weapon.cpp @@ -576,6 +576,8 @@ namespace game { case GUN_FIST: if(d->type==ENT_PLAYER && chainsawhudgun) sound = S_CHAINSAW_ATTACK; + //~if(d->quadmillis) + //~particle_splash(PART_FLAME, 60, 300, vec(0).sub(from), 0x802010, 0.24f); break; case GUN_SG: @@ -585,6 +587,8 @@ namespace game particle_flare(d->muzzle, d->muzzle, 200, PART_MUZZLE_FLASH3, 0xFFFFFF, 2.75f, d); loopi(guns[gun].rays) { + if(d->quadmillis) + particle_trail(PART_FLAME, 400, hudgunorigin(gun, from, rays[i], d), rays[i], 0x802010, 0.6f, 36); particle_splash(PART_SPARK, 20, 250, rays[i], 0xB49B4B, 0.24f); particle_flare(hudgunorigin(gun, from, rays[i], d), rays[i], 300, PART_STREAK, 0xFFC864, 0.28f); if(!local) adddecal(DECAL_BULLET, rays[i], vec(from).sub(rays[i]).safenormalize(), 2.0f); @@ -597,6 +601,8 @@ namespace game case GUN_PISTOL: { particle_splash(PART_SPARK, 200, 250, to, 0xB49B4B, 0.24f); + if(d->quadmillis) + particle_trail(PART_FLAME, 400, hudgunorigin(gun, from, to, d), to, 0x802010, 0.6f, 36); particle_flare(hudgunorigin(gun, from, to, d), to, 600, PART_STREAK, 0xFFC864, 0.28f); if(muzzleflash && d->muzzle.x >= 0) particle_flare(d->muzzle, d->muzzle, gun==GUN_CG ? 100 : 200, PART_MUZZLE_FLASH1, 0xFFFFFF, gun==GUN_CG ? 2.25f : 1.25f, d); @@ -606,6 +612,8 @@ namespace game } case GUN_RL: + if(d->quadmillis) + particle_trail(PART_FLAME, 400, hudgunorigin(gun, from, to, d), to, 0x802010, 0.6f, 36); if(muzzleflash && d->muzzle.x >= 0) particle_flare(d->muzzle, d->muzzle, 250, PART_MUZZLE_FLASH2, 0xFFFFFF, 3.0f, d); pspeed = guns[gun].projspeed; @@ -626,7 +634,9 @@ namespace game case GUN_RIFLE: particle_splash(PART_SPARK, 200, 250, to, 0xB49B4B, 0.24f); - particle_trail(PART_SMOKE, 500, hudgunorigin(gun, from, to, d), to, 0x404040, 0.6f, 20); + if(d->quadmillis) + particle_trail(PART_FLAME, 400, hudgunorigin(gun, from, to, d), to, 0x802010, 0.6f, 36); + particle_trail(PART_SMOKE, 500, hudgunorigin(gun, from, to, d), to, 0x404040, 0.6f, 18); if(muzzleflash && d->muzzle.x >= 0) particle_flare(d->muzzle, d->muzzle, 150, PART_MUZZLE_FLASH3, 0xFFFFFF, 1.25f, d); if(!local) adddecal(DECAL_BULLET, to, vec(from).sub(to).safenormalize(), 3.0f);