From d6d1a4375a14490f08de9bff39b99e01acd45cf0 Mon Sep 17 00:00:00 2001 From: MiranDMC Date: Fri, 29 Nov 2024 15:30:22 +0000 Subject: [PATCH] deploy: 42cbc473e0085ab1e81d25b7a33f30ae7a3602f8 --- assets/sa/classes.db | 1 + assets/sa/opcodes.txt | 2 +- assets/sa/sa.json | 34 +++++++++++----------------------- assets/sa/snippets.json | 2 +- ngsw.json | 2 +- 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/assets/sa/classes.db b/assets/sa/classes.db index 544dd231..c5da6439 100644 --- a/assets/sa/classes.db +++ b/assets/sa/classes.db @@ -2419,6 +2419,7 @@ PerlinNoiseFractal2D,0EF1,0,0,("x%f" "y%f" "octaves%i" "frequency%f" "amplitude% PerlinNoiseFractal3D,0EF2,0,0,("x%f" "y%f" "z%f" "octaves%i" "frequency%f" "amplitude%f" "lacunarity%f" "persistence%f" "result%f") Pow,0AEE,0,0,("number%f" "power%f" "result%f") Random,0099,0,0,("%i") +RandomChance,2708,1,0,() RandomFloatInRange,0208,0,0,("min%f" "max%f" "result%f") RandomIntInRange,0209,0,0,("min%i" "max%i" "result%i") RandomPercent,0E4D,1,0,("percent%i") diff --git a/assets/sa/opcodes.txt b/assets/sa/opcodes.txt index 19e5a07e..d90ea3e4 100644 --- a/assets/sa/opcodes.txt +++ b/assets/sa/opcodes.txt @@ -2310,7 +2310,7 @@ {2705:} [var result: int] = pick_random_int {values} [arguments] {2706:} [var result: float] = pick_random_float {values} [arguments] {2707:} [var result: string] = pick_random_text {values} [arguments] -{2708:} [var float] = [float] / [float] +{2708:} random_chance {2400:} copy_memory {src} [int] {dest} [int] {size} [int] {2401:} [var result: int] = read_memory_with_offset {address} [int] {offset} [int] {size} [int] {2402:} write_memory_with_offset {address} [int] {offset} [int] {size} [int] {value} [any] diff --git a/assets/sa/sa.json b/assets/sa/sa.json index b8f3c658..c5ddfd87 100644 --- a/assets/sa/sa.json +++ b/assets/sa/sa.json @@ -1,7 +1,7 @@ { "meta": { - "last_update": 1732892664620, - "version": "0.799", + "last_update": 1732894135888, + "version": "0.800", "url": "https://library.sannybuilder.com/#/sa" }, "extensions": [ @@ -63518,28 +63518,16 @@ "short_desc": "Selects one random text from provided values" }, { - "input": [ - { - "name": "", - "type": "float" - }, - { - "name": "", - "type": "float" - } - ], - "output": [ - { - "name": "", - "type": "float", - "source": "var_any" - } - ], "id": "2708", - "name": "FLOAT_DIV", - "num_params": 3, - "operator": "/", - "short_desc": "Divides the float value by another float value and writes the result into the variable" + "name": "RANDOM_CHANCE", + "num_params": 0, + "short_desc": "Sets random condition result, with percent chance to be true", + "class": "Math", + "member": "RandomChance", + "attrs": { + "is_static": true, + "is_condition": true + } } ] }, diff --git a/assets/sa/snippets.json b/assets/sa/snippets.json index 3440e1fb..320ac2d2 100644 --- a/assets/sa/snippets.json +++ b/assets/sa/snippets.json @@ -299,7 +299,7 @@ "2705": "int bikeModel = pick_random_int {values} 581 462 521 463", "2706": "float heading = pick_random_float {values} 0.0 90.0 -90.0 180.0 -180.0", "2707": "<%= output1 %> = <%= input1 %> * <%= input2 %>", - "2708": "<%= output1 %> = <%= input1 %> / <%= input2 %>" + "2708": "if\n random_chance {percent} 33.333\nthen\n print_help_string {text} \"1/3 chance\"\nend" }, "memory": { "2400": "get_var_pointer 0@ {store_to} 5@\nget_var_pointer 1@ {store_to} 6@\n\n2400: copy_memory {src} 5@ {dest} 6@ {size} 2 // replace two bytes in 1@", diff --git a/ngsw.json b/ngsw.json index edfa337c..9891e55b 100644 --- a/ngsw.json +++ b/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1732892732867, + "timestamp": 1732894208855, "index": "/index.html", "assetGroups": [ {