New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aresrpg/aresrpg-sdk

Package Overview
Dependencies
Maintainers
3
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aresrpg/aresrpg-sdk - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

package.json
{
"name": "@aresrpg/aresrpg-sdk",
"version": "3.0.2",
"version": "3.0.3",
"description": "General SDK to interract with AresRPG",

@@ -5,0 +5,0 @@ "type": "module",

@@ -12,15 +12,33 @@ import { MIST_PER_SUI } from '@mysten/sui/utils'

function get_element_from_hex(hex_color) {
hex_color = hex_color.replace('#', '')
if (hex_color.length !== 6) return 'invalid hex color'
switch (hex_color) {
case '#42FF00':
case '#6B956C':
return 'agility'
case '#707070':
case '#A17E52':
return 'strength'
case '#5E44FF':
case '#AC90F8':
return 'wisdom'
case '#6FBBEE':
case '#ADC0F4':
case '#AEE0F5':
case '#4FCAC0':
return 'chance'
case '#FF008A':
case '#C75151':
return 'vitality'
case '#DA8E2F':
case '#FCE370':
case '#FF5C00':
return 'intelligence'
default:
return 'chance'
}
}
const [r, g, b] = [0, 2, 4].map(i => parseInt(hex_color.slice(i, i + 2), 16))
if (r > g && r > b && r - g < 50 && r - b < 50) return 'strength' // Check for brown tones
return g > r && g > b
? 'agility'
: b > r && b > g
? 'chance'
: r > g && r > b
? 'intelligence'
: 'strength'
function get_divide_factor(powerfull, element) {
if (element === 'wisdom') return powerfull ? 3 : 5
if (element === 'vitality') return powerfull ? 1.1 : 1.4
return powerfull ? 1.5 : 2
}

@@ -35,3 +53,3 @@

// having the shark doll allows more stats on the fren
const divide_factor = powerfull ? 1.5 : 2
const divide_factor = get_divide_factor(powerfull, element)
const feed_level = mists_to_sui(stomach)

@@ -38,0 +56,0 @@ const stat_value = Math.floor(feed_level / divide_factor)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc