]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add flesh as a new material. Enjoy spawning player meshes and listening to them crunc...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 15:39:44 +0000 (18:39 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 15:39:44 +0000 (18:39 +0300)
qcsrc/menu/xonotic/dialog_sandboxtools.c
qcsrc/server/mutators/sandbox.qc

index f0ab9f438f571ab4d55ecc48f143533361f73992..a8144f5824c719d65eaea79bd93a69a6637d8018 100644 (file)
@@ -53,6 +53,7 @@ void XonoticSandboxToolsDialog_fill(entity me)
                        e.addValue(e, _("metal"), "1");
                        e.addValue(e, _("stone"), "2");
                        e.addValue(e, _("wood"), "3");
+                       e.addValue(e, _("wood"), "4");
                        e.configureXonoticTextSliderValues(e);
                me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox edit_object physics $menu_sandbox_edit_physics", 0));
                me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "0", _("Static")));
index fd61d2693bafd82d83b8ef3c1bea6243e36f024e..005cbb6a102bbf29d4ea5866bc865aeeb7abd19f 100644 (file)
@@ -4,6 +4,7 @@
 const float MATERIAL_METAL = 1;
 const float MATERIAL_STONE = 2;
 const float MATERIAL_WOOD = 3;
+const float MATERIAL_FLESH = 4;
 
 entity sandbox_EditObject_Get()
 {
@@ -40,6 +41,9 @@ void sandbox_Object_Touch()
                case MATERIAL_WOOD:
                        sound(self, CH_TRIGGER, strcat("object/impact_wood_", ftos(ceil(random() * 5)) , ".ogg"), VOL_BASE, ATTN_NORM);
                        break;
+               case MATERIAL_FLESH:
+                       sound(self, CH_TRIGGER, strcat("object/impact_flesh_", ftos(ceil(random() * 5)) , ".ogg"), VOL_BASE, ATTN_NORM);
+                       break;
                default:
                        break;
        }
@@ -106,7 +110,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                print_to(self, "^3scale value ^7- changes object scale. 0.5 is half size and 2 is double size");
                                print_to(self, "^3physics value ^7- object physics, 0 = static, 1 = movable, 2 = physical");
                                print_to(self, "^3force value ^7- amount of force applied to objects that are shot");
-                               print_to(self, "^3material value ^7- sets the material of the object. Valid materials are: 1 (metal), 2 (stone), 3 (wood)");
+                               print_to(self, "^3material value ^7- sets the material of the object. Valid materials are: 1 (metal), 2 (stone), 3 (wood), 4 (flesh)");
                                print_to(self, "^7The ^1drag object ^7key can be used to grab and carry objects. Players can only grab their own objects");
                                return TRUE;
 
@@ -363,9 +367,11 @@ MUTATOR_DEFINITION(sandbox)
                float i;
                for (i = 1; i <= 5; i++)
                {
+                       // precache material sounds
                        precache_sound(strcat("objects/impact_metal_", ftos(i), ".ogg"));
                        precache_sound(strcat("objects/impact_stone_", ftos(i), ".ogg"));
                        precache_sound(strcat("objects/impact_wood_", ftos(i), ".ogg"));
+                       precache_sound(strcat("objects/impact_flesh_", ftos(i), ".ogg"));
                }
        }