diff --git a/README.md b/README.md index 2d4d31bcb..cb1b75c6d 100644 --- a/README.md +++ b/README.md @@ -293,7 +293,7 @@ This artifact provides a +100 health boost plus a regeneration effect that heals ### Armor Nugget ~ Replaces Armor Bonus, Timebomb of the Ancients, Disc of Repulsion, Flechette ![](docimg/nuggetarmor.png) -Cumulative armor items that can increase resistance to all damage by as much as you can find. Each nugget adds 5% to the total. Above 100%, damage gets turned into additional health (up to the standard 100% cap). The upper cap for these is 200%. +Cumulative armor items that can increase resistance to all damage by as much as you can find. Each nugget adds 1% to the total. Above 100%, damage gets turned into additional health (up to the standard 100% cap). The upper cap for these is 200%. ### Blast Suit ~ Replaces Green Armor, Silver Shield, Mesh Armor ![](docimg/blastsuit.png) diff --git a/cvarinfo.txt b/cvarinfo.txt index e21856402..154a6f8bb 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -90,3 +90,121 @@ user bool swwm_rageshader = false; // alternate ragekit shader for people with server bool swwm_uncapalert = false; // all noise alerts have infinite range user int swwm_damagetarget = 0; // conditional healthbar hiding (1 - hide until damage is first taken, 2 - hide if at full health) server noarchive bool swwm_iseriouslywanttoplaythiswithbd = false; //self-explanatory + +// cross-session achievement cvars (0: locked, 1: unlocked, 2: notified) +nosave int swwm_achievement_gcsandwich = 0; +nosave int swwm_achievement_hdoom = 0; +nosave int swwm_achievement_onestanding = 0; +nosave int swwm_achievement_oopsie = 0; +nosave int swwm_achievement_ghost = 0; +nosave int swwm_achievement_clonk = 0; +nosave int swwm_achievement_allitems = 0; +nosave int swwm_achievement_conga = 0; +nosave int swwm_achievement_explogun = 0; +nosave int swwm_achievement_gravity = 0; +nosave int swwm_achievement_flight = 0; +nosave int swwm_achievement_cliffyb = 0; +nosave int swwm_achievement_par = 0; +nosave int swwm_achievement_fuck = 0; +nosave int swwm_achievement_oneguy = 0; +nosave int swwm_achievement_golden = 0; +nosave int swwm_achievement_gib = 0; +nosave int swwm_achievement_barrier = 0; +nosave int swwm_achievement_bossdash = 0; +nosave int swwm_achievement_sneeze = 0; +nosave int swwm_achievement_fuel = 0; +nosave int swwm_achievement_slayer = 0; +nosave int swwm_achievement_broccolidoccoli = 0; +nosave int swwm_achievement_dime = 0; +nosave int swwm_achievement_stomp = 0; +nosave int swwm_achievement_cheat = 0; +nosave int swwm_achievement_god = 0; +nosave int swwm_achievement_thruwall = 0; +nosave int swwm_achievement_mashiro = 0; +nosave int swwm_achievement_lead = 0; +nosave int swwm_achievement_love = 0; +nosave int swwm_achievement_butts = 0; +nosave int swwm_achievement_plush = 0; +nosave int swwm_achievement_bustin = 0; +nosave int swwm_achievement_moth = 0; +nosave int swwm_achievement_iwad = 0; +nosave int swwm_achievement_brake = 0; +nosave int swwm_achievement_rage = 0; +nosave int swwm_achievement_abort = 0; +nosave int swwm_achievement_parry = 0; +nosave int swwm_achievement_allkills = 0; +nosave int swwm_achievement_allsecrets = 0; +nosave int swwm_achievement_reflect = 0; +nosave int swwm_achievement_sekiro = 0; +nosave int swwm_achievement_hello = 0; +nosave int swwm_achievement_wave = 0; +nosave int swwm_achievement_friend = 0; +nosave int swwm_achievement_share = 0; +nosave int swwm_achievement_shock = 0; +nosave int swwm_achievement_balls = 0; +nosave int swwm_achievement_refresh = 0; +nosave int swwm_achievement_step = 0; +nosave int swwm_achievement_sunny = 0; +nosave int swwm_achievement_thicc = 0; +nosave int swwm_achievement_everything = 0; +nosave int swwm_achievement_allcoll = 0; +nosave int swwm_achievement_slemg = 0; +nosave int swwm_achievement_dosh = 0; +nosave int swwm_achievement_jump = 0; +nosave int swwm_achievement_ezkill = 0; +nosave int swwm_achievement_ligma = 0; +nosave int swwm_achievement_yeet = 0; +nosave int swwm_achievement_mbf = 0; +nosave int swwm_achievement_lightning = 0; +nosave int swwm_achievement_dakka = 0; +nosave int swwm_achievement_roast = 0; +nosave int swwm_achievement_dab = 0; +nosave int swwm_achievement_hnd = 0; +nosave int swwm_achievement_gepgun = 0; +nosave int swwm_achievement_fuller = 0; +nosave int swwm_achievement_tetris = 0; +nosave int swwm_achievement_pong = 0; +nosave int swwm_achievement_snake = 0; +nosave int swwm_achievement_smb = 0; +nosave int swwm_achievement_tyrian = 0; +nosave int swwm_achievement_bof = 0; +// cross-session progress cvars (everything else is part of a static thinker) +nosave int swwm_progress_gcsandwich = 0; +nosave int swwm_progress_ghost = 0; +nosave int swwm_progress_allitems = 0; +nosave int swwm_progress_gravity = 0; +nosave int swwm_progress_par = 0; +nosave int swwm_progress_fuck = 0; +nosave int swwm_progress_golden = 0; +nosave int swwm_progress_gib = 0; +nosave int swwm_progress_barrier = 0; +nosave int swwm_progress_bossdash = 0; +nosave int swwm_progress_sneeze = 0; +nosave int swwm_progress_fuel = 0; +nosave int swwm_progress_slayer = 0; +nosave int swwm_progress_stomp = 0; +nosave int swwm_progress_thruwall = 0; +nosave int swwm_progress_love = 0; +nosave int swwm_progress_butts = 0; +nosave int swwm_progress_bustin = 0; +nosave int swwm_progress_moth = 0; +nosave int swwm_progress_iwad = 0; +nosave int swwm_progress_brake = 0; +nosave int swwm_progress_rage = 0; +nosave int swwm_progress_parry = 0; +nosave int swwm_progress_allkills = 0; +nosave int swwm_progress_allsecrets = 0; +nosave int swwm_progress_reflect = 0; +nosave int swwm_progress_wave = 0; +nosave int swwm_progress_friend = 0; +nosave int swwm_progress_share = 0; +nosave int swwm_progress_shock = 0; +nosave int swwm_progress_balls = 0; +nosave int swwm_progress_refresh = 0; +nosave int swwm_progress_sunny = 0; +nosave int swwm_progress_thicc = 0; +nosave int swwm_progress_slemg = 0; +nosave int swwm_progress_jump = 0; +nosave int swwm_progress_roast = 0; +nosave int swwm_progress_dab = 0; +nosave int swwm_progress_gepgun = 0; diff --git a/language.version b/language.version index f29e820ab..3952955d5 100644 --- a/language.version +++ b/language.version @@ -1,2 +1,2 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r641 \cu(Fri 27 Nov 02:23:43 CET 2020)"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r642 \cu(Fri 27 Nov 11:56:48 CET 2020)"; diff --git a/zscript/swwm_armor.zsc b/zscript/swwm_armor.zsc index dc98b1411..01c11003d 100644 --- a/zscript/swwm_armor.zsc +++ b/zscript/swwm_armor.zsc @@ -4,7 +4,7 @@ Class ArmorNugget : SWWMArmor Default { Inventory.Icon "graphics/HUD/Icons/I_ArmorNugget.png"; - Inventory.Amount 5; + Inventory.Amount 1; Inventory.MaxAmount 200; Inventory.InterHubAmount 200; SWWMArmor.ArmorPriority 10; diff --git a/zscript/swwm_handler.zsc b/zscript/swwm_handler.zsc index 00ed7d547..152e632db 100644 --- a/zscript/swwm_handler.zsc +++ b/zscript/swwm_handler.zsc @@ -2167,7 +2167,16 @@ Class SWWMHandler : EventHandler if ( !item ) return; if ( SWWMCredits.Take(players[e.Args[0]],e.Args[1]) ) { - players[e.Args[0]].mo.GiveInventory(item,e.Args[2],true); + if ( (item is 'ArmorNuggetItem') || (item is 'HealthNuggetItem') ) + { + // these have to be given in a loop because fun reasons + for ( int i=0; i amt) && (inv2.Amount <= maxneed) && (cprice <= SWWMCredits.Get(players[consoleplayer])) ) + if ( (inv2.Amount > amt) && (inv2.Amount <= maxneed) && SWWMCredits.CanTake(players[consoleplayer],cprice) ) { price = cprice; amt = inv2.Amount; } } } + // nuggets can be bought in bulk + else if ( type is 'HealthNuggetItem' ) + { + let inv2 = GetDefaultByType(SWWMHealth(inv).giveme); + int maxneed = (inv2.MaxAmount-players[consoleplayer].Health); + for ( int j=5; j<=20; j+=5 ) + { + int cprice = int(inv.Stamina*(1.+.75*(j-1))); + if ( (j <= maxneed) && SWWMCredits.CanTake(players[consoleplayer],cprice) ) + { + price = cprice; + amt = j; + } + } + } + else if ( type is 'ArmorNuggetItem' ) + { + let inv2 = GetDefaultByType(SWWMSpareArmor(inv).giveme); + let cur2 = players[consoleplayer].mo.FindInventory(SWWMSpareArmor(inv).giveme); + int maxneed = cur2?(cur2.MaxAmount-cur2.Amount):inv2.MaxAmount; + for ( int j=5; j<=20; j+=5 ) + { + int cprice = int(inv.Stamina*(1.+.75*(j-1))); + if ( (j <= maxneed) && SWWMCredits.CanTake(players[consoleplayer],cprice) ) + { + price = cprice; + amt = j; + } + } + } // sort by unit price bool greater = false; for ( int j=0; j