diff --git a/PriceTable.md b/PriceTable.md index bb89cf7ec..a2ddd04b0 100644 --- a/PriceTable.md +++ b/PriceTable.md @@ -31,15 +31,15 @@ respective weapon. Crackshots | 8000 Ravagers | 12000 Warheads | 25000 - Sparkster | 150000 - Spark Unit | 20000 + Sparkster | 200000 + Spark Unit | 50000 Silver Bullet | 400000 - S.B. Mag | 30000 + S.B. Mag | 70000 Candygun | 1000000 - Candy Mag | 80000 + Candy Mag | 100000 Spare Gun | 600000 - Ynykron | 2000000 - Crystal Unit | 400000 + Ynykron | 2500000 + Crystal Unit | 1000000 #### DLC weapons and ammo (when available) @@ -59,11 +59,11 @@ These will be available long after the first release. Puntzer Gamma | 200000 SMW.05 Mag | 20000 EMP Carbine | 300000 - EMP Core | 35000 + EMP Core | 60000 PROWEL&TADEL | 1600000 - Insane Core | 40000 - S.H. Fun Ball | 2500000 - Fun Stuff | 500000 + Insane Core | 150000 + S.H. Fun Ball | 2000000 + Fun Stuff | 800000 #### Other items diff --git a/zscript/swwm_ammo.zsc b/zscript/swwm_ammo.zsc index 0c603724c..6a16736ac 100644 --- a/zscript/swwm_ammo.zsc +++ b/zscript/swwm_ammo.zsc @@ -655,7 +655,7 @@ Class SparkUnit : Ammo { Tag "$T_SPARKUNIT"; Inventory.PickupMessage "$T_SPARKUNIT"; - Stamina 20000; + Stamina 50000; Inventory.Amount 1; Inventory.MaxAmount 8; Ammo.BackpackAmount 1; @@ -681,7 +681,7 @@ Class SilverBulletAmmo : Ammo { Tag "$T_XSBMAG"; Inventory.PickupMessage "$T_XSBMAG"; - Stamina 6000; + Stamina 70000; Inventory.Amount 1; Inventory.MaxAmount 5; Ammo.BackpackAmount 1; @@ -707,7 +707,7 @@ Class CandyGunAmmo : Ammo { Tag "$T_CANDYMAG"; Inventory.PickupMessage "$T_CANDYMAG"; - Stamina 80000; + Stamina 100000; Inventory.Amount 1; Inventory.MaxAmount 4; Ammo.BackpackAmount 0; @@ -745,7 +745,7 @@ Class YnykronAmmo : Ammo { Tag "$T_YNYKRONAMMO"; Inventory.PickupMessage "$T_YNYKRONAMMO"; - Stamina 400000; + Stamina 1000000; Inventory.Amount 1; Inventory.MaxAmount 1; Ammo.BackpackAmount 0; diff --git a/zscript/swwm_common.zsc b/zscript/swwm_common.zsc index a4f990a4c..5f05cb480 100644 --- a/zscript/swwm_common.zsc +++ b/zscript/swwm_common.zsc @@ -73,6 +73,28 @@ Class SWWMUtility return (((p.y-l.v1.p.y)*l.delta.x+(l.v1.p.x-p.x)*l.delta.y) > double.epsilon); } + // box intersection check, for collision detection + static bool BoxIntersect( Actor a, Actor b, Vector3 ofs = (0,0,0), int pad = 0 ) + { + Vector3 diff = level.Vec3Diff(level.Vec3Offset(a.pos,ofs),b.pos); + if ( (abs(diff.x) > (a.radius+b.radius+pad)) || (abs(diff.y) > (a.radius+b.radius+pad)) ) return false; + if ( (diff.z > a.height+pad) || (diff.z < -(b.height+pad)) ) return false; + return true; + } + + // extruded box intersection check, useful when checking things that might be hit along a path + static bool ExtrudeIntersect( Actor a, Actor b, Vector3 range, int steps, int pad = 0 ) + { + if ( steps <= 0 ) return BoxIntersect(a,b,pad:pad); + double step = 1./steps; + for ( double i=step; i<=1.; i+=step ) + { + if ( BoxIntersect(a,b,range*i,pad) ) + return true; + } + return false; + } + // sphere intersection check, useful for proximity detection static bool SphereIntersect( Actor a, Vector3 p, double radius ) { diff --git a/zscript/swwm_deathlydeathcannon.zsc b/zscript/swwm_deathlydeathcannon.zsc index 3ffc6e478..871c975ec 100644 --- a/zscript/swwm_deathlydeathcannon.zsc +++ b/zscript/swwm_deathlydeathcannon.zsc @@ -30,7 +30,7 @@ Class Ynykron : SWWMWeapon Obituary "$O_YNYKRON"; Weapon.SlotNumber 0; Weapon.SelectionOrder 1000; - Stamina 2000000; + Stamina 2500000; Weapon.AmmoType1 "YnykronAmmo"; Weapon.AmmoGive1 1; +SWWMWEAPON.NOFIRSTGIVE; diff --git a/zscript/swwm_menu.zsc b/zscript/swwm_menu.zsc index 4a347c2a7..7f6edb62f 100644 --- a/zscript/swwm_menu.zsc +++ b/zscript/swwm_menu.zsc @@ -1040,6 +1040,10 @@ Class SWWMKnowledgeBaseMenu : GenericMenu drag = 3; } } + else if ( (curtab == TAB_TRADING) && isrclick ) + { + MenuEvent(MKEY_Back,false); + } else if ( (curtab == TAB_TRADING) && !isrclick ) { if ( !sub ) @@ -1495,12 +1499,12 @@ Class SWWMKnowledgeBaseMenu : GenericMenu } } } + // sort by unit price bool greater = false; for ( int j=0; j price2 ) continue; + if ( inv.Stamina > inv2.Stamina ) continue; greater = true; storelist.Insert(j,type); storeunits.Insert(j,amt); @@ -2135,7 +2139,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu { if ( !storelist[i] ) continue; let def = GetDefaultByType(storelist[i]); - if ( storeunits[i] > 1 ) str = String.Format("%dx %s",storeunits[i],def.GetTag()); + if ( (storeunits[i] > 1) || (storelist[i] is 'Ammo') ) str = String.Format("%dx %s",storeunits[i],def.GetTag()); else str = def.GetTag(); int clscol = Font.CR_WHITE; if ( storelist[i] is 'Weapon' ) clscol = Font.CR_GOLD; diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index bd99296d5..fff9b69eb 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -283,11 +283,11 @@ Class Demolitionist : PlayerPawn else { if ( swwm_extraalert ) A_AlertMonsters(800); - dashboost *= .5; + dashboost *= (player.cmd.buttons&BT_USER2)?.8:.1; } mystats.fuelusage += dashfuel-max(0.,dashfuel-dashboost); dashfuel = max(0.,dashfuel-dashboost); - dashcooldown = 40; + dashcooldown = min(40,max(10,int(dashcooldown*1.4))); fuelcooldown = max(60,fuelcooldown); if ( (dashfuel <= 0.) || (dashboost <= 0.) ) SetStateLabel("DashEnd"); @@ -580,9 +580,7 @@ Class Demolitionist : PlayerPawn a = bi.Thing; if ( !a || (a == self) || !a.bSHOOTABLE || a.bTHRUACTORS ) continue; Vector3 diff = level.Vec3Diff(pos,a.pos); - if ( (abs(diff.x) > (radius+a.radius+spd*2)) || (abs(diff.y) > (radius+a.radius+spd*2)) ) continue; - if ( (diff.z > (height+spd*2)) || (diff.z < -(a.height+spd*2)) ) continue; - if ( diff.unit() dot dir.unit() < .35 ) continue; + if ( !SWWMUtility.ExtrudeIntersect(self,a,dir*spd,8,16) ) continue; if ( !CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue; // large monsters will stop the player A_QuakeEx(4,4,4,10,0,128,"",QF_RELATIVE|QF_SCALEDOWN); @@ -809,7 +807,7 @@ Class Demolitionist : PlayerPawn if ( (dodge.length() > 0) && (dashcooldown <= 0) && (dashfuel > 20.) && player.cmd.buttons&BT_USER2 && level.IsJumpingAllowed() ) { dashdir = dodge.unit(); - dashcooldown = 40; + dashcooldown = 10; dashboost = 20.; bOnMobj = false; if ( player.cheats & CF_REVERTPLEASE ) diff --git a/zscript/swwm_sparkyboi.zsc b/zscript/swwm_sparkyboi.zsc index db424b9bb..371a014eb 100644 --- a/zscript/swwm_sparkyboi.zsc +++ b/zscript/swwm_sparkyboi.zsc @@ -1554,7 +1554,7 @@ Class Sparkster : SWWMWeapon Weapon.SlotNumber 7; Weapon.UpSound "biospark/select"; Weapon.SelectionOrder 1600; - Stamina 150000; + Stamina 200000; Weapon.AmmoType1 "SparkUnit"; Weapon.AmmoGive1 1; Sparkster.ClipCount 8;