Skip to content

Instantly share code, notes, and snippets.

@kenos1
Created February 11, 2024 05:03
Show Gist options
  • Save kenos1/ddadd6406fdf4cbe30aceeec11dc9fa9 to your computer and use it in GitHub Desktop.
Save kenos1/ddadd6406fdf4cbe30aceeec11dc9fa9 to your computer and use it in GitHub Desktop.
Gun HUD Ammo Color
// ==UserScript==
// @name Gun HUD Ammo Color
// @namespace Violentmonkey Scripts
// @match https://suroi.io/*
// @grant none
// @version 1.0
// @author Kenos
// @description silly
// ==/UserScript==
"use strict";(()=>{var l=class{bitCount;definitions;idStringToNumber={};constructor(t){this.bitCount=Math.ceil(Math.log2(t.length)),this.definitions=t;for(let r=0,a=t.length;r<a;r++){let o=t[r].idString;if(this.idStringToNumber[o]!==void 0)throw new Error(`Duplicated idString: ${o}`);this.idStringToNumber[o]=r}}reify(t){return typeof t=="string"?this.fromString(t):t}fromString(t){let r=this.idStringToNumber[t];if(r===void 0)throw new Error(`Unknown idString: ${t}`);return this.definitions[r]}writeToStream(t,r){t.writeBits(this.idStringToNumber[typeof r=="string"?r:r.idString],this.bitCount)}readFromStream(t){let r=t.readBits(this.bitCount);return r>=this.definitions.length&&console.warn(`ID out of range: ${r} (max: ${this.definitions.length-1})`),this.definitions[r]}[Symbol.iterator](){return this.definitions[Symbol.iterator]()}};var p=new l([{idString:"12g",name:"12 gauge",itemType:1,maxStackSize:20},{idString:"556mm",name:"5.56mm",itemType:1,maxStackSize:60},{idString:"762mm",name:"7.62mm",itemType:1,maxStackSize:60},{idString:"9mm",name:"9mm",itemType:1,maxStackSize:90},{idString:"127mm",name:"12.7mm",itemType:1,maxStackSize:10,hideUnlessPresent:!0},{idString:"curadell",name:"Curadell",itemType:1,maxStackSize:10,hideUnlessPresent:!0},{idString:"power_cell",name:"P.O.W.E.R. cell",itemType:1,maxStackSize:10,ephemeral:!0},{idString:"bb",name:"6mm BB",itemType:1,maxStackSize:240,ephemeral:!0}]);var g=new l([{idString:"gauze",name:"Gauze",itemType:4,healType:0,restoreAmount:15,useTime:3,useText:"Applying"},{idString:"medikit",name:"Medikit",itemType:4,healType:0,restoreAmount:100,useTime:6,useText:"Using"},{idString:"cola",name:"Cola",itemType:4,healType:1,restoreAmount:25,useTime:3,useText:"Drinking"},{idString:"tablets",name:"Tablets",itemType:4,healType:1,restoreAmount:50,useTime:5,useText:"Taking"}]);var y=new l([{idString:"1x_scope",name:"1x Scope",itemType:7,zoomLevel:48,noDrop:!0,giveByDefault:!0},{idString:"2x_scope",name:"2x Scope",itemType:7,zoomLevel:62},{idString:"4x_scope",name:"4x Scope",itemType:7,zoomLevel:83},{idString:"8x_scope",name:"8x Scope",itemType:7,zoomLevel:116},{idString:"15x_scope",name:"15x Scope",itemType:7,zoomLevel:178}]);var e=Object.freeze({create(i,t){return{x:i,y:t}},add(i,t){return this.create(i.x+t.x,i.y+t.y)},addComponent(i,t,r){return this.create(i.x+t,i.y+r)},sub(i,t){return this.create(i.x-t.x,i.y-t.y)},subComponent(i,t,r){return this.create(i.x-t,i.y-r)},scale(i,t){return this.create(i.x*t,i.y*t)},clone(i){return this.create(i.x,i.y)},rotate(i,t){let r=Math.cos(t),a=Math.sin(t);return this.create(i.x*r-i.y*a,i.x*a+i.y*r)},squaredLength(i){return i.x*i.x+i.y*i.y},length(i){return Math.sqrt(e.squaredLength(i))},dotProduct(i,t){return i.x*t.x+i.y*t.y},project(i,t){return this.scale(t,this.dotProduct(i,t)/this.squaredLength(t))},normalizeSafe(i,t){t??=this.create(1,0);let r=1e-6,a=e.length(i);return a>r?{x:i.x/a,y:i.y/a}:e.clone(t)},normalize(i){let r=e.length(i);return{x:i.x/r,y:i.y/r}},invert(i){return this.create(-i.x,-i.y)},equals(i,t,r=.001){return Math.abs(i.x-t.x)<=r&&Math.abs(i.y-t.y)<=r},angleBetweenVectors(i,t){return Math.acos((i.x*t.x+i.y*t.y)/Math.sqrt(e.length(i)*e.length(t)))},lerp(i,t,r){return e.add(e.scale(i,1-r),e.scale(t,r))},fromPolar(i,t=1){return{x:Math.cos(i)*t,y:Math.sin(i)*t}},addAdjust(i,t,r){if(r===0)return e.add(i,t);let a,o;switch(r){case 1:a=t.y,o=-t.x;break;case 2:a=-t.x,o=-t.y;break;case 3:a=-t.y,o=t.x;break}return e.add(i,e.create(a,o))}});var f=[{idString:"frag_grenade",name:"Frag Grenade",itemType:3,speedMultiplier:.92,cookSpeedMultiplier:.7,hitboxRadius:1,impactDamage:1,obstacleMultiplier:20,fuseTime:4e3,cookTime:150,throwTime:150,cookable:!0,maxThrowDistance:96,image:{position:e.create(60,43),angle:60},speedCap:.15,detonation:{explosion:"frag_explosion"},animation:{pinImage:"proj_frag_pin",liveImage:"proj_frag",leverImage:"proj_frag_lever",cook:{leftFist:e.create(2.5,0),rightFist:e.create(-.5,2.15)},throw:{leftFist:e.create(1.9,-1.75),rightFist:e.create(4,2.15)}}},{idString:"smoke_grenade",name:"Smoke Grenade",itemType:3,speedMultiplier:.92,cookSpeedMultiplier:.7,hitboxRadius:1,impactDamage:1,obstacleMultiplier:20,fuseTime:2e3,cookTime:150,throwTime:150,maxThrowDistance:96,image:{position:e.create(60,43),angle:60},speedCap:.15,detonation:{explosion:"smoke_explosion",particles:{type:"smoke_grenade_particle",count:10,deployAnimation:{duration:4e3,staggering:{delay:300,initialAmount:2}},spawnRadius:15}},animation:{pinImage:"proj_smoke_pin",liveImage:"proj_smoke",leverImage:"proj_smoke_lever",cook:{cookingImage:"proj_smoke_nopin",leftFist:e.create(2.5,0),rightFist:e.create(-.5,2.15)},throw:{leftFist:e.create(1.9,-1.75),rightFist:e.create(4,2.15)}}}];function M(i){return i&&typeof i=="object"&&!Array.isArray(i)}function c(i,...t){if(!t.length)return i;let[r,...a]=t;for(let o in r){let n=o,[m,u]=[r[n],i[n]];if(M(u)){c(u,m);continue}i[n]=m}return c(i,...a)}function d(i){Object.freeze(i);for(let t in i){let r=i[t];typeof r=="object"&&r!==null&&d(r)}return i}var D={};for(let i of[...g,...p,...y,...f]){let t=0;switch(!0){case(i.itemType===1&&i.ephemeral):t=1/0;break;case(i.itemType===7&&i.giveByDefault):t=1;break}D[i.idString]=t}Object.freeze(D);var h=40,b=Object.freeze([0,0,2,3]),O=d({protocolVersion:13,gridSize:32,tickrate:h,msPerTick:1e3/h,maxPosition:1632,player:{radius:2.25,nameMaxLength:16,defaultName:"Player",defaultHealth:100,maxAdrenaline:100,inventorySlotTypings:b,maxWeapons:b.length,killLeaderMinKills:3,maxMouseDist:128},airdrop:{fallTime:8e3,flyTime:3e4,damage:300}});var w=[{idString:"ak47",name:"AK-47",itemType:0,ammoType:"762mm",ammoSpawnAmount:90,capacity:30,reloadTime:2.5,fireDelay:100,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:150,fireMode:2,shotSpread:2,moveSpread:6,length:7.5,fists:{left:e.create(120,-2),right:e.create(45,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,2)},casingParticles:[{position:e.create(4,.6)}],ballistics:{damage:14,obstacleMultiplier:1.5,speed:.26,range:160}},{idString:"arx160",name:"ARX-160",itemType:0,ammoType:"762mm",ammoSpawnAmount:90,capacity:30,reloadTime:2.75,fireDelay:75,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:145,fireMode:2,shotSpread:5,moveSpread:10,length:6.6,fists:{left:e.create(98,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(70,0)},casingParticles:[{position:e.create(4,.6)}],ballistics:{damage:12.25,obstacleMultiplier:1.5,speed:.26,range:160}},{idString:"aug",name:"AUG",itemType:0,ammoType:"556mm",ammoSpawnAmount:90,fireDelay:70,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:120,fireMode:2,shotSpread:4,moveSpread:11,length:6.7,fists:{left:e.create(105,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(75,-4)},casingParticles:[{position:e.create(4,.5)}],capacity:30,reloadTime:2.25,ballistics:{damage:10.5,obstacleMultiplier:1.5,speed:.28,range:160}},{idString:"acr",name:"ACR",itemType:0,ammoType:"556mm",ammoSpawnAmount:90,fireDelay:72.5,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:130,fireMode:2,shotSpread:2,moveSpread:7,noMuzzleFlash:!0,length:6.2,fists:{left:e.create(95,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(75,-1)},casingParticles:[{position:e.create(4,.5)}],capacity:30,reloadTime:3,ballistics:{damage:14.5,obstacleMultiplier:1.5,speed:.3,range:160,tracer:{opacity:.5}}},{idString:"m3k",name:"M3K",itemType:0,ammoType:"12g",ammoSpawnAmount:18,capacity:9,reloadTime:.55,fireDelay:700,switchDelay:700,speedMultiplier:.92,recoilMultiplier:.5,recoilDuration:500,fireMode:0,shotSpread:5,moveSpread:7,jitterRadius:.5,bulletCount:9,length:7.7,fists:{left:e.create(105,-3),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,5)},casingParticles:[{position:e.create(4,.6)}],singleReload:!0,ballistics:{damage:9,obstacleMultiplier:1,speed:.2,range:80}},{idString:"model_37",name:"Model 37",itemType:0,ammoType:"12g",ammoSpawnAmount:15,capacity:5,reloadTime:.75,fireDelay:900,switchDelay:900,speedMultiplier:.92,recoilMultiplier:.5,recoilDuration:550,fireMode:0,shotSpread:11,moveSpread:14,jitterRadius:1.25,bulletCount:10,length:7.9,fists:{left:e.create(122,-3),right:e.create(45,0),rightZIndex:4,animationDuration:100},image:{position:e.create(95,0)},casingParticles:[{position:e.create(4.5,.6),ejectionDelay:450,velocity:{y:{min:2,max:5,randomSign:!0}}}],singleReload:!0,ballistics:{damage:10,obstacleMultiplier:1,speed:.16,range:48,tracer:{length:.7}}},{idString:"hp18",name:"HP18",itemType:0,ammoType:"12g",ammoSpawnAmount:15,capacity:5,reloadTime:.725,singleReload:!0,fireDelay:300,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.6,recoilDuration:600,fireMode:0,bulletCount:18,shotSpread:24,moveSpread:28,jitterRadius:1.75,centerJitterOnMuzzle:!0,length:8,fists:{left:e.create(120,-1),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(100,0)},casingParticles:[{position:e.create(4,.6)}],ballistics:{damage:4,obstacleMultiplier:.5,speed:.12,range:40,tracer:{length:.5}}},{idString:"flues",name:"Flues",itemType:0,ammoType:"12g",ammoSpawnAmount:10,capacity:2,reloadTime:2.6,fireDelay:175,switchDelay:250,speedMultiplier:.92,recoilMultiplier:.8,recoilDuration:100,fireMode:0,bulletCount:10,shotSpread:11,moveSpread:14,jitterRadius:1.5,length:6,fists:{left:e.create(95,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(75,0)},casingParticles:[{position:e.create(4,.6),count:2,velocity:{y:{min:8,max:15,randomSign:!0}},on:"reload"}],ballistics:{damage:10,obstacleMultiplier:1,speed:.16,range:48,tracer:{length:.5}}},{idString:"vepr12",name:"Vepr-12",itemType:0,ammoType:"12g",ammoSpawnAmount:20,capacity:5,reloadTime:2.4,fireDelay:450,switchDelay:650,speedMultiplier:.92,recoilMultiplier:.7,recoilDuration:550,fireMode:2,shotSpread:11,moveSpread:14,jitterRadius:1.25,length:7.1,bulletCount:10,fists:{left:e.create(98,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(81,2)},casingParticles:[{position:e.create(4.3,.6)}],ballistics:{damage:10,obstacleMultiplier:1,speed:.16,range:48,tracer:{length:.5}}},{idString:"mosin",name:"Mosin-Nagant",itemType:0,ammoType:"762mm",ammoSpawnAmount:20,capacity:5,reloadTime:.85,singleReload:!0,fireDelay:900,switchDelay:900,speedMultiplier:.92,recoilMultiplier:.45,recoilDuration:750,fireMode:0,shotSpread:1,moveSpread:2,length:8.7,shootOnRelease:!0,fists:{left:e.create(115,-4),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,6.5)},casingParticles:[{position:e.create(4,.6),ejectionDelay:700}],ballistics:{damage:70,obstacleMultiplier:1,speed:.33,range:250,tracer:{width:1.4,length:2.5}}},{idString:"tango_51",name:"Tango 51",itemType:0,ammoType:"762mm",ammoSpawnAmount:20,capacity:5,reloadTime:2.6,fireDelay:900,switchDelay:900,speedMultiplier:.92,recoilMultiplier:.4,recoilDuration:1e3,fireMode:0,shotSpread:.3,moveSpread:.6,length:8.9,shootOnRelease:!0,fists:{left:e.create(106,-1),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,5)},casingParticles:[{position:e.create(4,.6),ejectionDelay:450}],ballistics:{damage:79,obstacleMultiplier:1,speed:.4,range:280,tracer:{width:1.6,length:3.5}}},{idString:"barrett",name:"Barrett M95",itemType:0,ammoType:"127mm",ammoSpawnAmount:20,capacity:5,reloadTime:3.4,fireDelay:1400,switchDelay:900,speedMultiplier:.92,recoilMultiplier:.3,recoilDuration:1500,fireMode:0,shotSpread:.5,moveSpread:4,length:9.2,shootOnRelease:!0,fists:{left:e.create(115,-4),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,4)},casingParticles:[{position:e.create(2,.6),ejectionDelay:700}],ballistics:{damage:129,obstacleMultiplier:1,speed:.45,range:300,tracer:{width:2.5,length:4}}},{idString:"m1895",name:"M1895",itemType:0,ammoType:"762mm",ammoSpawnAmount:28,fireDelay:375,switchDelay:250,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:135,fireMode:0,shotSpread:2,moveSpread:5,length:5.1,fists:{left:e.create(40,0),right:e.create(40,0),leftZIndex:4,rightZIndex:4,animationDuration:100},image:{position:e.create(70,0)},casingParticles:[{position:e.create(3.5,.5),count:7,velocity:{x:{min:-15,max:-4},y:{min:5,max:18,randomSign:!0}},on:"reload"}],capacity:7,reloadTime:2.1,ballistics:{damage:24.5,obstacleMultiplier:1.5,speed:.26,range:160},dual:{leftRightOffset:1.3,fireDelay:187.5,shotSpread:3,moveSpread:6,capacity:14,reloadTime:4}},{idString:"g19",name:"G19",itemType:0,ammoType:"9mm",ammoSpawnAmount:60,fireDelay:110,switchDelay:250,speedMultiplier:.92,recoilMultiplier:.8,recoilDuration:90,fireMode:0,shotSpread:7,moveSpread:14,length:4.7,fists:{left:e.create(40,0),right:e.create(40,0),leftZIndex:4,rightZIndex:4,animationDuration:100},image:{position:e.create(65,0)},casingParticles:[{position:e.create(3.5,.5),velocity:{y:{min:2,max:18}}}],capacity:15,reloadTime:1.5,ballistics:{damage:11.75,obstacleMultiplier:1,speed:.14,range:120},dual:{leftRightOffset:1.3,fireDelay:75,shotSpread:10,moveSpread:18,capacity:30,reloadTime:2.9}},{idString:"radio",name:"Radio",itemType:0,summonAirdrop:!0,ammoType:"curadell",ammoSpawnAmount:1,fireDelay:500,switchDelay:0,speedMultiplier:.92,recoilMultiplier:1,recoilDuration:0,fireMode:0,shotSpread:7,moveSpread:14,length:4.7,fists:{left:e.create(38,-35),right:e.create(38,35),leftZIndex:4,rightZIndex:4,animationDuration:100},image:{position:e.create(65,35)},casingParticles:[{position:e.create(3.5,1),ejectionDelay:500}],noMuzzleFlash:!0,capacity:1,reloadTime:1.4,ballistics:{tracer:{image:"radio_wave",opacity:.8,particle:!0,zIndex:20},damage:0,obstacleMultiplier:1,speed:.01,range:50,noCollision:!0}},{idString:"cz75a",name:"CZ-75A",itemType:0,ammoType:"9mm",ammoSpawnAmount:64,fireDelay:60,switchDelay:250,speedMultiplier:.92,recoilMultiplier:.8,recoilDuration:90,fireMode:2,shotSpread:12,moveSpread:19,length:5.1,fists:{left:e.create(40,0),right:e.create(40,0),leftZIndex:4,rightZIndex:4,animationDuration:100},image:{position:e.create(70,-1)},casingParticles:[{position:e.create(3.5,.5),velocity:{y:{min:2,max:18}}}],capacity:16,reloadTime:1.9,ballistics:{damage:9,obstacleMultiplier:1,speed:.16,range:85},dual:{leftRightOffset:1.3,fireDelay:30,shotSpread:17,moveSpread:35,capacity:32,reloadTime:3.7}},{idString:"saf_200",name:"SAF-200",itemType:0,ammoType:"9mm",ammoSpawnAmount:90,capacity:30,reloadTime:1.8,fireDelay:75,burstProperties:{shotsPerBurst:3,burstCooldown:325},switchDelay:300,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:300,fireMode:1,shotSpread:3,moveSpread:4,length:5.9,fists:{left:e.create(95,-3),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(71,0)},casingParticles:[{position:e.create(4,.5)}],ballistics:{damage:15.5,obstacleMultiplier:1,speed:.25,range:130}},{idString:"m16a4",name:"M16A4",itemType:0,ammoType:"556mm",ammoSpawnAmount:90,capacity:30,reloadTime:2.2,fireDelay:75,burstProperties:{shotsPerBurst:3,burstCooldown:325},switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:350,fireMode:1,shotSpread:1,moveSpread:2.5,length:8.6,fists:{left:e.create(120,-3),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(100,0)},casingParticles:[{position:e.create(3.5,.5)}],ballistics:{damage:21,obstacleMultiplier:1.5,speed:.3,range:180}},{idString:"micro_uzi",name:"Micro Uzi",itemType:0,ammoType:"9mm",ammoSpawnAmount:96,capacity:32,reloadTime:1.75,fireDelay:40,switchDelay:300,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:60,fireMode:2,shotSpread:9,moveSpread:19,length:5.8,fists:{left:e.create(85,-6),right:e.create(40,0),rightZIndex:4,animationDuration:100},casingParticles:[{position:e.create(3.5,.6)}],image:{position:e.create(80,0)},ballistics:{damage:7.75,obstacleMultiplier:1,speed:.16,range:85}},{idString:"vector",name:"Vector",itemType:0,ammoType:"9mm",ammoSpawnAmount:99,capacity:33,reloadTime:1.7,fireDelay:35,switchDelay:300,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:60,fireMode:2,shotSpread:2,moveSpread:7,length:7.1,fists:{left:e.create(85,-6),right:e.create(40,0),rightZIndex:4,animationDuration:100},casingParticles:[{position:e.create(4.5,.6)}],image:{position:e.create(80,0)},ballistics:{damage:6.75,obstacleMultiplier:1,speed:.25,range:85}},{idString:"mp40",name:"MP40",itemType:0,ammoType:"9mm",ammoSpawnAmount:96,capacity:32,reloadTime:2.1,fireDelay:90,switchDelay:300,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:150,fireMode:2,shotSpread:2,moveSpread:4,length:6.55,fists:{left:e.create(103,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(76,-3)},casingParticles:[{position:e.create(4,.6)}],ballistics:{damage:11,obstacleMultiplier:1,speed:.25,range:130}},{idString:"mcx_spear",name:"MCX Spear",itemType:0,ammoType:"762mm",ammoSpawnAmount:80,capacity:20,reloadTime:2.75,fireDelay:87.5,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:130,fireMode:2,shotSpread:2,moveSpread:4,length:7.7,fists:{left:e.create(105,-6),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(80,0)},casingParticles:[{position:e.create(5,.5)}],ballistics:{damage:16,obstacleMultiplier:1.5,speed:.3,range:180,tracer:{length:1.4}}},{idString:"lewis_gun",name:"Lewis Gun",itemType:0,ammoType:"762mm",ammoSpawnAmount:94,capacity:47,reloadTime:3.4,fireDelay:120,switchDelay:400,speedMultiplier:.8,recoilMultiplier:.65,recoilDuration:200,fireMode:2,shotSpread:2,moveSpread:9,length:11.8,fists:{left:e.create(140,-10),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(120,0)},casingParticles:[{position:e.create(4.7,1.6)}],ballistics:{damage:16,obstacleMultiplier:2.5,speed:.3,range:180,tracer:{width:1.1,length:1.4}}},{idString:"stoner_63",name:"Stoner 63",itemType:0,ammoType:"556mm",ammoSpawnAmount:150,capacity:75,reloadTime:3.8,fireDelay:90,switchDelay:400,speedMultiplier:.9,recoilMultiplier:.7,recoilDuration:175,fireMode:2,shotSpread:3,moveSpread:4.5,length:7.7,fists:{left:e.create(105,-3),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,0)},casingParticles:[{position:e.create(4,.6),velocity:{y:{min:-15,max:-10}}},{position:e.create(4.2,.6),frame:"m13_link",velocity:{x:{min:-6,max:8},y:{min:-25,max:-10}}}],ballistics:{damage:14.25,obstacleMultiplier:2,speed:.28,range:180,tracer:{width:1.1,length:1.4}}},{idString:"m1_garand",name:"M1 Garand",itemType:0,ammoType:"762mm",ammoSpawnAmount:40,capacity:8,reloadTime:2.1,fireDelay:200,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.75,recoilDuration:200,fireMode:0,shotSpread:1,moveSpread:3.5,length:8.1,fists:{left:e.create(110,-3),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(87,1)},casingParticles:[{position:e.create(4,.6),velocity:{y:{min:4,max:15}}},{position:e.create(4,.6),frame:"enbloc",velocity:{x:{min:1,max:3,randomSign:!0},y:{min:2,max:5,randomSign:!0}},on:"reload"}],ballistics:{damage:39,obstacleMultiplier:1.5,speed:.3,range:230,tracer:{length:2},lastShotFX:!0}},{idString:"vss",name:"VSS",itemType:0,ammoType:"9mm",ammoSpawnAmount:60,capacity:20,reloadTime:2.15,fireDelay:140,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.7,recoilDuration:140,fireMode:0,shotSpread:2,moveSpread:3.5,length:6.9,fists:{left:e.create(110,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(80,0)},casingParticles:[{position:e.create(4,.5)}],noMuzzleFlash:!0,ballistics:{damage:22,obstacleMultiplier:1.5,speed:.22,range:160,tracer:{opacity:.5,length:1.5}}},{idString:"sr25",name:"SR-25",itemType:0,ammoType:"762mm",ammoSpawnAmount:80,capacity:20,reloadTime:2.5,fireDelay:190,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.7,recoilDuration:190,fireMode:0,shotSpread:1,moveSpread:3.5,length:7.2,fists:{left:e.create(110,0),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(80,0)},casingParticles:[{position:e.create(4.2,.5)}],ballistics:{damage:28.5,obstacleMultiplier:1.5,speed:.3,range:230,tracer:{length:1.5}}},{idString:"mini14",name:"Mini-14",itemType:0,ammoType:"556mm",ammoSpawnAmount:80,capacity:20,reloadTime:2.4,fireDelay:155,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.8,recoilDuration:155,fireMode:0,shotSpread:2,moveSpread:5,length:7.4,fists:{left:e.create(96,-2),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(85,0)},casingParticles:[{position:e.create(5,.5),velocity:{y:{min:4,max:15}}}],ballistics:{damage:25.5,obstacleMultiplier:1.5,speed:.3,range:230,tracer:{length:1.5}}},{idString:"usas12",name:"USAS-12",itemType:0,ammoType:"12g",ammoSpawnAmount:30,capacity:10,reloadTime:3,fireDelay:525,switchDelay:400,speedMultiplier:.92,recoilMultiplier:.7,recoilDuration:525,fireMode:2,shotSpread:5,moveSpread:14,length:7.7,fists:{left:e.create(115,-1),right:e.create(40,0),rightZIndex:4,animationDuration:100},image:{position:e.create(90,-3.5)},casingParticles:[{position:e.create(4,.6)}],ballistics:{damage:8,obstacleMultiplier:1,speed:.16,range:55,onHitExplosion:"usas_explosion",goToMouse:!0,tracer:{length:.5,color:16711680}}},{idString:"s_g17",name:"G17 (scoped)",itemType:0,ammoType:"bb",fireDelay:35,switchDelay:250,speedMultiplier:1.5,recoilMultiplier:.99,recoilDuration:10,fireMode:2,shotSpread:.5,moveSpread:5,length:6.2,fists:{left:e.create(40,0),right:e.create(40,0),leftZIndex:3,rightZIndex:3,animationDuration:80},noMuzzleFlash:!0,image:{position:e.create(65,0)},capacity:100,reloadTime:1.5,ballistics:{damage:2,obstacleMultiplier:.5,speed:.1,range:70,tracer:{width:.7,opacity:.85,color:16744448}}},{idString:"deathray",name:"Death Ray",itemType:0,ammoType:"power_cell",capacity:1,reloadTime:1.4,fireDelay:40,switchDelay:500,speedMultiplier:.92,recoilMultiplier:.8,recoilDuration:100,fireMode:2,shotSpread:.15,moveSpread:.1,killstreak:!0,length:8.7,fists:{left:e.create(135,-6),right:e.create(75,0),animationDuration:100},image:{position:e.create(90,0)},noMuzzleFlash:!0,casingParticles:[{position:e.create(4.5,.6),on:"reload"}],ballistics:{damage:800,obstacleMultiplier:2,speed:4,range:400,penetration:{players:!0,obstacles:!0},tracer:{image:"power_cell_trail",length:10}}},{idString:"revitalizer",name:"Revitalizer",itemType:0,ammoType:"12g",ammoSpawnAmount:15,capacity:5,reloadTime:.75,fireDelay:925,switchDelay:925,speedMultiplier:.92,recoilMultiplier:.5,recoilDuration:550,fireMode:0,shotSpread:11,moveSpread:14,killstreak:!0,consistentPatterning:!0,bulletCount:10,length:7.5,fists:{left:e.create(120,-2),right:e.create(45,0),animationDuration:100,rightZIndex:4},image:{position:e.create(80,0)},casingParticles:[{position:e.create(4,.6),ejectionDelay:450,velocity:{y:{min:2,max:5,randomSign:!0}}}],singleReload:!0,ballistics:{damage:10,obstacleMultiplier:1,speed:.16,range:48,tracer:{length:.7}},wearerAttributes:{passive:{maxHealth:.51,maxAdrenaline:.8},on:{kill:[{limit:5,maxHealth:1.488,maxAdrenaline:1.201,minAdrenaline:20,speedBoost:1.02},{healthRestored:230,adrenalineRestored:30}],damageDealt:[{healthRestored:2,adrenalineRestored:1.5}]}}}],S=w.map(i=>{if(i.dual===void 0)return[i];let t=c({},i,i.dual,{idString:`dual_${i.idString}`,name:`Dual ${i.name}`,isDual:!0,singleVariant:i.idString});return delete t.dual,delete t.fists,delete t.image,delete t.casingParticles,delete i.dual,i.dualVariant=t.idString,[i,t]}).flat();var T=window.location.href;console.log(T);var x=document.getElementById("weapons-container"),v=S,G=[["9mm","#dcb200"],["12g","#d40000"],["556mm","#00b820"],["762mm","#0054b8"],["127mm","#002602"]],R=new MutationObserver(()=>{let i=x.getElementsByClassName("inventory-slot");for(let t of i){t.style.outlineWidth="5px";let r=t.getElementsByClassName("item-image")[0];if(r.src===""){t.removeAttribute("style");continue}let a=r.src.slice(T.length+17,-4);console.log(a);let o=v.find(m=>a===m.idString);if(o===void 0){t.removeAttribute("style");continue}let n=G.find(m=>o.ammoType===m[0]);console.log(n),n!==void 0&&(console.log(n[1]),t.style.background=n[1]+"70",t.style.outlineColor=n[1])}});R.observe(x,{subtree:!0,childList:!0});})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment