-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf2e4db
commit 6c3d625
Showing
45 changed files
with
527 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
void onInit(CBlob@ this) | ||
{ | ||
this.addCommandID("consume"); | ||
} | ||
|
||
void GetButtonsFor(CBlob@ this, CBlob@ caller) | ||
{ | ||
CBitStream params; | ||
params.write_u16(caller.getNetworkID()); | ||
caller.CreateGenericButton(22, Vec2f(0, 0), this, this.getCommandID("consume"), "Drink!", params); | ||
} | ||
|
||
void onCommand(CBlob@ this, u8 cmd, CBitStream @params) | ||
{ | ||
if (cmd == this.getCommandID("consume")) | ||
{ | ||
this.getSprite().PlaySound("gasp.ogg"); | ||
this.getSprite().PlaySound("Gurgle2.ogg"); | ||
|
||
CBlob@ caller = getBlobByNetworkID(params.read_u16()); | ||
if (caller !is null) | ||
{ | ||
if (!caller.exists("drunk") || caller.get_u16("drunk") == 0) caller.AddScript("Drunk.as"); | ||
|
||
caller.set_u16("drunk", Maths::Min(caller.get_u16("drunk") + 1, 250)); | ||
caller.set_u32("next sober", getGameTime()); | ||
|
||
if (getNet().isServer()) | ||
{ | ||
this.server_Die(); | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
$sprite_factory = generic_sprite | ||
@$sprite_scripts = | ||
$sprite_texture = Beer.png | ||
s32_sprite_frame_width = 8 | ||
s32_sprite_frame_height = 8 | ||
f32 sprite_offset_x = 0 | ||
f32 sprite_offset_y = 0 | ||
|
||
$sprite_gibs_start = *start* | ||
|
||
$gib_type = predefined | ||
$gib_style = stone | ||
u8_gib_count = 5 | ||
@u8_gib_frame = 4; 5; 6; 7; | ||
f32 velocity = 10.0 | ||
f32 offset_x = 8.0 | ||
f32 offset_y = 0.0 | ||
|
||
$sprite_gibs_end = *end* | ||
|
||
$sprite_animation_start = *start* | ||
|
||
$sprite_animation_default_name = default | ||
u16 sprite_animation_default_time = 0 | ||
u8_sprite_animation_default_loop = 0 | ||
@u16 sprite_animation_default_frames = 0; | ||
|
||
$sprite_animation_end = *end* | ||
|
||
$shape_factory = box2d_shape | ||
@$shape_scripts = | ||
f32 shape_mass = 5.0 | ||
f32 shape_radius = 4.0 | ||
f32 shape_friction = 0.75 | ||
f32 shape_elasticity = 0.2 | ||
f32 shape_buoyancy = 0.8 | ||
f32 shape_drag = 0.5 | ||
bool shape_collides = yes | ||
bool shape_ladder = no | ||
bool shape_platform = no | ||
@f32 verticesXY = | ||
|
||
u8 block_support = 0 | ||
bool block_background = no | ||
bool block_lightpasses = no | ||
bool block_snaptogrid = no | ||
|
||
$movement_factory = | ||
|
||
$brain_factory = | ||
|
||
$attachment_factory = box2d_attachment | ||
@$attachment_scripts = | ||
@$attachment_points = PICKUP; 0; 0; 1; 0; 0; | ||
|
||
$inventory_factory = | ||
|
||
$name = beer | ||
@$scripts = Beer.as; | ||
Stone.as; | ||
NoPlayerCollision.as; | ||
f32 health = 1.0 | ||
$inventory_name = Bear's Beer | ||
$inventory_icon = - | ||
u8 inventory_icon_frame = 0 | ||
u8 inventory_icon_frame_width = 0 | ||
u8 inventory_icon_frame_height = 0 | ||
u8 inventory_used_width = 1 | ||
u8 inventory_used_height = 1 | ||
u8 inventory_max_stacks = 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#include "Knocked.as"; | ||
|
||
void onInit(CBlob@ this) | ||
{ | ||
this.addCommandID("consume"); | ||
} | ||
|
||
void onTick(CBlob@ this) | ||
{ | ||
if (this.hasTag("dead")) return; | ||
u16 level = this.get_u16("drunk"); | ||
|
||
// print("tick" + getGameTime()); | ||
|
||
if (this.get_u32("next sober") < getGameTime() && XORRandom(1000) == 0) | ||
{ | ||
this.set_u16("drunk", Maths::Max(this.get_u16("drunk") - 1, 0)); | ||
} | ||
|
||
if (level > 0 && getKnocked(this) < 10 && XORRandom(4000 / (1 + level * 1.5f)) == 0) | ||
{ | ||
u8 knock = 5 + XORRandom(20) * level; | ||
|
||
SetKnocked(this, knock); | ||
this.getSprite().PlaySound("drunk_fx" + XORRandom(5), 0.8f, this.getSexNum() == 0 ? 1.0f : 2.0f); | ||
} | ||
|
||
if (getNet().isClient()) | ||
{ | ||
if (this.isMyPlayer()) | ||
{ | ||
f32 rot; | ||
rot += Maths::Sin(getGameTime() / 30.0f) * level * 1.8f; | ||
rot += Maths::Cos(getGameTime() / 25.0f) * level * 1.3f; | ||
rot += Maths::Sin(380 + getGameTime() / 40.0f) * level * 2.5f; | ||
|
||
CCamera@ cam = getCamera(); | ||
cam.setRotation(rot); | ||
} | ||
} | ||
|
||
if (level == 0) | ||
{ | ||
print("sober"); | ||
|
||
this.getCurrentScript().runFlags |= Script::remove_after_this; | ||
|
||
if (getNet().isClient() && this.isMyPlayer()) | ||
{ | ||
CCamera@ cam = getCamera(); | ||
cam.setRotation(0); | ||
} | ||
} | ||
} | ||
|
||
void onDie(CBlob@ this) | ||
{ | ||
if (getNet().isClient() && this.isMyPlayer()) | ||
{ | ||
CCamera@ cam = getCamera(); | ||
cam.setRotation(0); | ||
} | ||
|
||
this.set_u16("drunk", 0); | ||
|
||
// print("die"); | ||
} | ||
|
||
f32 onHit(CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData) | ||
{ | ||
f32 modifier = Maths::Max(0.3f, Maths::Min(1, Maths::Pow(0.80f, this.get_u16("drunk")))); | ||
// print("" + modifier); | ||
return damage * modifier; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
void onInit(CBlob@ this) | ||
{ | ||
this.addCommandID("consume"); | ||
} | ||
|
||
void GetButtonsFor(CBlob@ this, CBlob@ caller) | ||
{ | ||
CBitStream params; | ||
params.write_u16(caller.getNetworkID()); | ||
caller.CreateGenericButton(22, Vec2f(0, 0), this, this.getCommandID("consume"), "Eat!", params); | ||
} | ||
|
||
void onCommand(CBlob@ this, u8 cmd, CBitStream @params) | ||
{ | ||
if (cmd == this.getCommandID("consume")) | ||
{ | ||
this.getSprite().PlaySound("Huuu.ogg", 1.0f, 1.5f); | ||
this.getSprite().PlaySound("Gurgle2.ogg"); | ||
|
||
CBlob@ caller = getBlobByNetworkID(params.read_u16()); | ||
if (caller !is null) | ||
{ | ||
if (!caller.exists("bobomaxed") || caller.get_u8("bobomaxed") == 0) caller.AddScript("Bobomaxed.as"); | ||
|
||
caller.set_u8("bobomaxed", Maths::Min(caller.get_u8("bobomaxed") + 1, 250)); | ||
|
||
if (getNet().isServer()) | ||
{ | ||
this.server_Die(); | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
$sprite_factory = generic_sprite | ||
@$sprite_scripts = | ||
$sprite_texture = Bobomax.png | ||
s32_sprite_frame_width = 8 | ||
s32_sprite_frame_height = 8 | ||
f32 sprite_offset_x = 0 | ||
f32 sprite_offset_y = 0 | ||
|
||
$sprite_gibs_start = *start* | ||
|
||
$gib_type = predefined | ||
$gib_style = stone | ||
u8_gib_count = 5 | ||
@u8_gib_frame = 4; 5; 6; 7; | ||
f32 velocity = 10.0 | ||
f32 offset_x = 8.0 | ||
f32 offset_y = 0.0 | ||
|
||
$sprite_gibs_end = *end* | ||
|
||
$sprite_animation_start = *start* | ||
|
||
$sprite_animation_default_name = default | ||
u16 sprite_animation_default_time = 0 | ||
u8_sprite_animation_default_loop = 0 | ||
@u16 sprite_animation_default_frames = 0; | ||
|
||
$sprite_animation_end = *end* | ||
|
||
$shape_factory = box2d_shape | ||
@$shape_scripts = | ||
f32 shape_mass = 5.0 | ||
f32 shape_radius = 4.0 | ||
f32 shape_friction = 0.75 | ||
f32 shape_elasticity = 0.2 | ||
f32 shape_buoyancy = 0.8 | ||
f32 shape_drag = 0.5 | ||
bool shape_collides = yes | ||
bool shape_ladder = no | ||
bool shape_platform = no | ||
@f32 verticesXY = | ||
|
||
u8 block_support = 0 | ||
bool block_background = no | ||
bool block_lightpasses = no | ||
bool block_snaptogrid = no | ||
|
||
$movement_factory = | ||
|
||
$brain_factory = | ||
|
||
$attachment_factory = box2d_attachment | ||
@$attachment_scripts = | ||
@$attachment_points = PICKUP; 0; 0; 1; 0; 0; | ||
|
||
$inventory_factory = | ||
|
||
$name = bobomax | ||
@$scripts = Bobomax.as; | ||
Stone.as; | ||
NoPlayerCollision.as; | ||
f32 health = 1.0 | ||
$inventory_name = Bobomax | ||
$inventory_icon = - | ||
u8 inventory_icon_frame = 0 | ||
u8 inventory_icon_frame_width = 0 | ||
u8 inventory_icon_frame_height = 0 | ||
u8 inventory_used_width = 1 | ||
u8 inventory_used_height = 1 | ||
u8 inventory_max_stacks = 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.