Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification station #321

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6ecbe70
Basic Building and useless button
Wunarg Jun 2, 2021
21dd1ee
Creating empty menu
Wunarg Jun 2, 2021
3eb000d
Can now tag objects
Wunarg Jun 2, 2021
1466b28
First functional modifier
Wunarg Jun 2, 2021
09a2f47
Can Modify Vehicles
Wunarg Jun 3, 2021
cc29265
Made Aerodynamik less stupid
Wunarg Jun 3, 2021
375d9d4
Comments and smaller stuff
Wunarg Jun 3, 2021
0cd3589
Removed unnessecary team stuff
Wunarg Jun 3, 2021
3b6c9a9
No longer modifies held buildables
Wunarg Jun 3, 2021
88e4c5d
2 new modifiers
Wunarg Jun 3, 2021
f1c464e
Dynamite Explosion on death modifier
Wunarg Jun 3, 2021
2a320f1
Slightly reduce explosion area
Wunarg Jun 3, 2021
f69e66c
Added the station to the builder menu
Wunarg Jun 3, 2021
d89aa7d
Bouncy Modifier
Wunarg Jun 3, 2021
97bf919
Some small comments
Wunarg Jun 3, 2021
4ee5a3f
Repair "Modifier"
Wunarg Jun 4, 2021
a4578c2
Reinforce Option and Unbound bool
Wunarg Jun 4, 2021
d571601
Modification Blueprint
Wunarg Jun 4, 2021
05243e1
Less Friction Modifier
Wunarg Jun 4, 2021
4c22958
Fixed radius and added basic icon stuff
Wunarg Jun 4, 2021
62e9e53
Improved some icons a little bit
Wunarg Jun 4, 2021
64690f2
Regeneration Modifer (ludacrously expensive)
Wunarg Jun 4, 2021
3b95959
Returning Modifier (Fun!)
Wunarg Jun 4, 2021
fedd7ac
Merge branch 'master' into Modification_Station
Wunarg Jun 5, 2021
cc65107
Improved Returning Mod
Wunarg Jun 5, 2021
ad86a12
Buoyancy Modifier
Wunarg Jun 5, 2021
329f8ef
Automaticly detaches held things
Wunarg Jun 6, 2021
e99feb4
Waterproofing modifier
Wunarg Jun 8, 2021
399a35b
Merge branch 'master' into Modification_Station
Wunarg Jun 8, 2021
4b58e9e
Basic Gun Modifier preparations
Wunarg Jun 8, 2021
523e838
3 gun modifiers
Wunarg Jun 8, 2021
b6a96e8
Harmless Gun modifier
Wunarg Jun 8, 2021
a2305f6
Tiny comment
Wunarg Jun 8, 2021
2a4a108
Adding scripts now server compatible
Wunarg Jun 9, 2021
8b4b09f
Now works on local servers
Wunarg Jun 9, 2021
5dee2a3
Merge branch 'master' into Modification_Station
Wunarg Jun 9, 2021
06f4517
Merge branch 'master' into Modification_Station
Wunarg Jun 27, 2021
374aa55
Merge branch 'master' into Modification_Station
Wunarg Jun 27, 2021
9984dfc
Merge branch 'master' into Modification_Station
Wunarg Jun 28, 2021
1955552
Harmless also make recoil 0 so it can be used in more fun ways
Wunarg Jun 28, 2021
73b5230
Heavy guns cost 2x to modify
Wunarg Jun 28, 2021
d7c3ba5
Merge branch 'master' into Modification_Station
Wunarg Jul 1, 2021
2593844
1 new gun modifier
Wunarg Jul 2, 2021
5a09f3d
Sulphur Lantern modifier
Wunarg Jul 2, 2021
27fe98d
Also reignites with the lantern modifier
Wunarg Jul 2, 2021
d0b186c
Merge branch 'master' into Modification_Station
Wunarg Jul 2, 2021
872e55e
Frictionless now also works on people
Wunarg Jul 2, 2021
68ac8b8
sticky modifier
Wunarg Jul 2, 2021
d3ac4e2
Merge branch 'master' into Modification_Station
Wunarg Jul 11, 2021
9502683
Merge branch 'master' into Modification_Station
Wunarg Jul 20, 2021
7e9b5cb
Merge branch 'master' into Modification_Station
Wunarg Aug 5, 2021
586f870
Merge branch 'master' into Modification_Station
Wunarg Mar 8, 2022
2aa7489
Increase shop size
Wunarg Mar 8, 2022
4e8d6f5
Increased Maximum dakka costs
Wunarg Mar 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void addCommonBuilderBlocks(BuildBlock[][]@ blocks, int teamnum = 7)
AddIconToken("$icon_nursery$","Nursery.png",Vec2f(40, 32), 5, teamnum);
AddIconToken("$icon_library$", "Library.png", Vec2f(40, 24), 0, teamnum);
AddIconToken("$icon_workshop$", "Building.png", Vec2f(40, 24), 0);
AddIconToken("$icon_modificationstation$", "ModificationStation.png", Vec2f(24, 24), 0, teamnum);

//Automation
AddIconToken("$icon_conveyor$", "Conveyor.png", Vec2f(8, 8), 0, teamnum);
Expand Down Expand Up @@ -444,6 +445,15 @@ void addCommonBuilderBlocks(BuildBlock[][]@ blocks, int teamnum = 7)
b.size.Set(40, 32);
blocks[1].push_back(b);
}
{
BuildBlock b(0, "modificationstation", "$icon_modificationstation$", "Modification Station \n Modify various things.");
AddRequirement(b.reqs, "blob", "mat_stone", "Stone", 100);
AddRequirement(b.reqs, "blob", "mat_wood", "Wood", 200);
AddRequirement(b.reqs, "coin", "", "Coins", 200);
b.buildOnGround = true;
b.size.Set(24, 24);
blocks[1].push_back(b);
}
{
BuildBlock b(0, "library", "$icon_library$", "Library\nBuy and sell various blueprints.");
AddRequirement(b.reqs, "blob", "mat_stone", "Stone", 125);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Material config file
# $ string
# @ array

# sprite

$sprite_factory = generic_sprite

@$sprite_scripts =
$sprite_texture = Blueprints.png
s32_sprite_frame_width = 16
s32_sprite_frame_height = 16
f32 sprite_offset_x = 0
f32 sprite_offset_y = 0

$sprite_gibs_start = *start*

$gib_type = predefined
$gib_style = stone
u8_gib_count = 4
@u8_gib_frame = 4; 5; 6; 7;
f32 velocity = 10.0
f32 offset_x = 0.0
f32 offset_y = 0.0

$sprite_gibs_end = *end*

$sprite_animation_start = *start*

# default
$sprite_animation_default_name = default
u16 sprite_animation_default_time = 0
u8_sprite_animation_default_loop = 0
@u16 sprite_animation_default_frames = 4;

$sprite_animation_end = *end*

$shape_factory = box2d_shape

@$shape_scripts =
f32 shape_mass = 1.0
f32 shape_radius = 5.0
f32 shape_friction = 0.8
f32 shape_elasticity = 0.3
f32 shape_buoyancy = 0.76
f32 shape_drag = 0.4
bool shape_collides = yes
bool shape_ladder = no
bool shape_platform = no
#block_collider
@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 =
# name; pixel offset (from center) X; offset Y; socket/plug 0/1; controller; radius
@$attachment_points = PICKUP; 0; 0; 1; 0; 0;

$inventory_factory =

# general

$name = bp_modification
@$scripts = IgnoreDamage.as;
NoPlayerCollision.as;
Blueprint.as;
f32_health = 1.0
# looks & behaviour inside inventory
$inventory_name = Blueprint (Modification)
$inventory_icon = Blueprints.png
u8 inventory_icon_frame = 0
u8 inventory_icon_frame_width = 16
u8 inventory_icon_frame_height = 16
u8 inventory_used_width = 1
u8 inventory_used_height = 1
u8 inventory_max_stacks = 1
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ LootItem@[] c_items =
LootItem("juggernauthammer", 1, 1, 50),
LootItem("gyromat", 1, 1, 500),
LootItem("bp_chemistry", 1, 1, 175),
LootItem("bp_modification", 1, 0, 1000), //This is the only way to get this so chances are a bit higher
LootItem("hobo", 1, 1, 122),
LootItem("cube", 1, 0, 1) //poggers
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// A script by TFlippy

#include "Requirements.as";
#include "ShopCommon.as";
#include "Descriptions.as";
#include "CheckSpam.as";
#include "CTFShopCommon.as";
#include "MakeMat.as";

Random traderRandom(Time());

void onInit(CBlob@ this)
{
this.set_TileType("background tile", CMap::tile_castle_back);

//this.Tag("upkeep building");
//this.set_u8("upkeep cap increase", 0);
//this.set_u8("upkeep cost", 5);

this.getSprite().SetZ(-50); //background
this.getShape().getConsts().mapCollisions = false;

this.Tag("builder always hit");
this.Tag("change team on fort capture");

this.set_Vec2f("shop offset", Vec2f(0,0));
this.set_Vec2f("shop menu size", Vec2f(4, 5));
this.set_u8("shop icon", 23);
this.Tag(SHOP_AUTOCLOSE);

this.set_bool("Unbound Modifiers", false); //Does not start with the unbound modifier

this.getCurrentScript().tickFrequency = 150;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
$sprite_factory = generic_sprite

@$sprite_scripts = Wooden.as;
ModificationStation.as;

$sprite_texture = ModificationStation.png
s32_sprite_frame_width = 24
s32_sprite_frame_height = 24
f32 sprite_offset_x = 0
f32 sprite_offset_y = 0

$sprite_gibs_start = *start*

$gib_type = predefined
$gib_style = wood
u8_gib_count = 10 #number of gibs
@u8_gib_frame = 1; 2; 3;
f32_velocity = 10.0
f32_offset_x = 0.0
f32_offset_y = 0.0

$sprite_gibs_end = *end*

$sprite_animation_start = *start*

# destruction
$sprite_animation_destruction_name = destruction
u16_sprite_animation_destruction_time = 0
u8_sprite_animation_destruction_loop = 0
@u16_sprite_animation_destruction_frames = 0; 1; 2;

$sprite_animation_end = *end*

# ball

$shape_factory = box2d_shape

@$shape_scripts =
f32 shape_mass = 10.0
f32 shape_radius = 0.0
f32 shape_friction = 1.0
f32 shape_elasticity = 0.0
f32 shape_buoyancy = 0.0
f32 shape_drag = 1.0
bool shape_collides = no
bool shape_ladder = no
bool shape_platform = no
#block_collider
@f32 verticesXY = 0.0; 0.0;
24.0; 0.0;
24.0; 24.0;
0.0; 24.0;

u8 block_support = 0
bool block_background = no
bool block_lightpasses = no
bool block_snaptogrid = no

$movement_factory =
$brain_factory =
$attachment_factory =
$inventory_factory =

# general

$name = modificationstation
@$scripts = DefaultNoBuild.as;
AlignToTiles.as;
DecayInWater.as;
ModificationStation.as;
IsFlammable.as;
BuildingEffects.as;
#FallOnNoSupport.as;
DieOnCollapse.as;
SimpleSupport.as;
ModifierShop.as;
WoodenHit.as;
Wooden.as;
f32_health = 5.0
# looks & behaviour inside inventory
$inventory_name = Modification Station
$inventory_icon = ModificationStation.png
u8 inventory_icon_frame = 7
u8 inventory_icon_frame_width = 24
u8 inventory_icon_frame_height = 24
u8 inventory_used_width = 2
u8 inventory_used_height = 2
u8 inventory_max_stacks = 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include "Explosion.as";

void onInit(CBlob@ this)
{
this.Tag("explosive");
}

void onDie(CBlob@ this)
{
DoExplosion(this);
}

string[] particles =
{
"LargeSmoke",
"Explosion.png"
};

void DoExplosion(CBlob@ this)
{
CRules@ rules = getRules();
if (!shouldExplode(this, rules))
{
addToNextTick(this, rules, DoExplosion);
return;
}

if (this.hasTag("exploded")) return;

f32 random = XORRandom(16);
f32 angle = -this.get_f32("bomb angle");
// print("Modifier: " + modifier + "; Quantity: " + this.getQuantity());

this.set_f32("map_damage_radius", (40.0f + random));
this.set_f32("map_damage_ratio", 0.50f);

Explode(this, 40.0f + random, 25.0f);

for (int i = 0; i < 10; i++)
{
Vec2f dir = getRandomVelocity(angle, 1, 120);
dir.x *= 2;
dir.Normalize();

LinearExplosion(this, dir, 16.0f + XORRandom(16), 16 + XORRandom(16), 3, 2.00f, Hitters::explosion);
}

if(isClient())
{

Vec2f pos = this.getPosition();
CMap@ map = getMap();

for (int i = 0; i < 20; i++)
{
MakeParticle(this, Vec2f( XORRandom(64) - 32, XORRandom(64) - 48), getRandomVelocity(-angle, XORRandom(220) * 0.01f, 90), particles[XORRandom(particles.length)]);
}

this.Tag("exploded");
this.getSprite().Gib();
}
}

void MakeParticle(CBlob@ this, const Vec2f pos, const Vec2f vel, const string filename = "SmallSteam")
{
if (!isClient()) return;

ParticleAnimated(filename, this.getPosition() + pos, vel, float(XORRandom(360)), 0.5f + XORRandom(100) * 0.01f, 1 + XORRandom(4), XORRandom(100) * -0.00005f, true);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

void onTick(CBlob@ this)
{
Vec2f vel = this.getVelocity();
if (vel.y > 0.5f)
{
this.AddForce(Vec2f(0, -0.4f) * this.getMass());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

void onCollision(CBlob@ this, CBlob@ blob, bool solid, Vec2f normal)
{
if (blob !is null ? !blob.isCollidable() : !solid)
{
return;
}

f32 vellen = this.getOldVelocity().Length();
//print(" "+vellen);
if (vellen >= 8.0f) //Dies when colliding with too much velocity, slightly lower velocity than most bombs
{
this.Tag("DoExplode"); //Can explode in case this is a bomb
this.server_Die();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

void onInit(CBlob@ this)
{
this.getCurrentScript().tickFrequency = 60;
this.getCurrentScript().removeIfTag = "dead";
}

void onTick(CBlob@ this)
{
this.server_Heal(0.25f);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

void onInit(CBlob@ this)
{
//this.set_u16("ReturningMod Target");
this.getCurrentScript().tickFrequency = 30;
this.getCurrentScript().removeIfTag = "dead";
}

void onTick(CBlob@ this)
{
CBlob@ target = getBlobByNetworkID(this.get_u16("ReturningMod Target"));

if(target != null && !target.hasTag("dead")) //No target no moving
{
Vec2f direction = target.getPosition() - this.getPosition();
direction.Normalize();
direction += Vec2f(0, -2.0f);
//print("Test");
this.AddForce(direction * this.getMass() * 2.0f);
MakeParticle(this, -direction * 0.2f, "SmallSteam");
//this.getSprite().PlaySound("/Jetpack_Offblast.ogg"); too loud
}
else
{
this.RemoveScript("ReturningMod.as");
}
}

void MakeParticle(CBlob@ this, const Vec2f vel, const string filename = "SmallSteam")
{
if (!isClient()) return;

const f32 rad = this.getRadius();
Vec2f random = Vec2f(XORRandom(128) - 64, XORRandom(128) - 64) * 0.015625f * rad;
ParticleAnimated(filename, this.getPosition() + random, vel, float(XORRandom(360)), 1.0f, 1 + XORRandom(2), -0.005f, true);
}
Loading