forked from Mirrors/openclonk
Adjusted firing power for weapons.
Bow, Grenade Launcher and Javelin use a local variable shooting_strength to determine range. No change here but I need this.shapetextures
parent
88148ac966
commit
5d6773b656
|
@ -18,7 +18,7 @@ public func FinishedAiming(object clonk, int angle)
|
|||
if(Contents(0)->~IsArrow())
|
||||
{
|
||||
var arrow = Contents(0)->TakeObject();
|
||||
arrow->Launch(angle,100,clonk);
|
||||
arrow->Launch(angle,this.shooting_strength,clonk);
|
||||
if(king_size)
|
||||
{
|
||||
AddEffect("ExplosiveArrow",arrow,100,1,this);
|
||||
|
|
|
@ -24,7 +24,7 @@ public func DoThrow(object clonk, int angle)
|
|||
var div = 60; // 40% is converted to the direction of the throwing angle.
|
||||
var xdir = clonk->GetXDir(1000);
|
||||
var ydir = clonk->GetYDir(1000);
|
||||
var speed = clonk.ThrowSpeed * 21 + (100 - div) * Sqrt(xdir**2 + ydir**2) / 100;
|
||||
var speed = clonk.ThrowSpeed * this.shooting_strength + (100 - div) * Sqrt(xdir**2 + ydir**2) / 100;
|
||||
var jav_x = div * xdir / 100 + Sin(angle, speed);
|
||||
var jav_y = div * ydir / 100 - Cos(angle, speed);
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
// has extra slot
|
||||
#include Library_HasExtraSlot
|
||||
|
||||
// Initial velocity of the arrow
|
||||
local shooting_strength = 100;
|
||||
|
||||
private func Hit()
|
||||
{
|
||||
Sound("Hits::Materials::Wood::WoodHit?");
|
||||
|
@ -143,7 +146,7 @@ public func FinishedAiming(object clonk, int angle)
|
|||
if(Contents(0)->~IsArrow())
|
||||
{
|
||||
var arrow = Contents(0)->TakeObject();
|
||||
arrow->Launch(angle,100,clonk);
|
||||
arrow->Launch(angle,shooting_strength,clonk);
|
||||
Sound("Objects::Weapons::Bow::Shoot?");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
//Uses the extra slot library
|
||||
#include Library_HasExtraSlot
|
||||
|
||||
// Initial velocity of the bomb
|
||||
local shooting_strength = 75;
|
||||
|
||||
func Hit()
|
||||
{
|
||||
Sound("Hits::GeneralHit?");
|
||||
|
@ -156,7 +159,7 @@ private func FireWeapon(object clonk, int angle)
|
|||
var IX=Sin(180-angle,MuzzleFront);
|
||||
var IY=Cos(180-angle,MuzzleUp)+MuzzleOffset;
|
||||
|
||||
shot->LaunchProjectile(angle, 0, 75, IX, IY);
|
||||
shot->LaunchProjectile(angle, 0, shooting_strength, IX, IY);
|
||||
shot->~Fuse(true);
|
||||
shot->SetController(clonk->GetController());
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
#include Library_Stackable
|
||||
|
||||
// Multiplication factor to clonk.ThrowSpeed
|
||||
local shooting_strength = 21;
|
||||
|
||||
public func MaxStackCount() { return 3; }
|
||||
// Note that the javelin damage also takes the speed into account. A direct eye-to-eye hit will do roughly this damage.
|
||||
public func JavelinStrength() { return 18; }
|
||||
|
@ -104,7 +107,7 @@ public func DoThrow(object clonk, int angle)
|
|||
var div = 60; // 40% is converted to the direction of the throwing angle.
|
||||
var xdir = clonk->GetXDir(1000);
|
||||
var ydir = clonk->GetYDir(1000);
|
||||
var speed = clonk.ThrowSpeed * 21 + (100 - div) * Sqrt(xdir**2 + ydir**2) / 100;
|
||||
var speed = clonk.ThrowSpeed * shooting_strength + (100 - div) * Sqrt(xdir**2 + ydir**2) / 100;
|
||||
var jav_x = div * xdir / 100 + Sin(angle, speed);
|
||||
var jav_y = div * ydir / 100 - Cos(angle, speed);
|
||||
|
||||
|
|
Loading…
Reference in New Issue