Compare commits

...

64 Commits

Author SHA1 Message Date
Julius Michaelis d675bd4c1d Fix mismerge: forgot a few lines in config.h.cmake 2012-12-30 21:20:16 +01:00
Julius Michaelis 02641b8baa Fix float()-docs: Typo in closing tag 2012-12-28 18:11:17 +01:00
Julius Michaelis 35c3d4a421 Merge branch 'master' into floating-point
(Just merged. Nothing was tested.)

Conflicts:
	config.h.cmake
	docs/de.po
	planet/Objects.ocd/Libraries.ocd/PowerConsumer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Grass.ocd/Script.c
	planet/Tests.ocf/AirRace.ocs/Extra.ocd/Rocket.ocd/Script.c
	planet/Tests.ocf/AirRace.ocs/Extra.ocd/WeaponSpawn.ocd/Script.c
	planet/Tests.ocf/AirRace.ocs/Script.c
	planet/Tests.ocf/Experimental.ocd/LiftTower.ocd/Hook.ocd/Script.c
	planet/Tests.ocf/Experimental.ocd/LiftTower.ocd/Rope.ocd/Script.c
	planet/Tests.ocf/Moss_Test.ocs/Script.c
	src/script/C4AulParse.cpp
2012-12-28 17:52:14 +01:00
Julius Michaelis d338c8c0e2 Pre-merge: change line format in de.po 2012-12-28 14:36:05 +01:00
Julius Michaelis 0a214d91cd Convert to float before applying precision in Set*Dir functions 2012-10-06 00:10:46 +02:00
Julius Michaelis 2923c1f1d0 Forgot to merge that ONE important patch at last merge. 2012-10-03 23:50:21 +02:00
Julius Michaelis 4d65c480ea Fix digging: Don't stop if the angle is too steep 2012-10-03 23:46:39 +02:00
Julius Michaelis 7b0ee6377c Make FnAngle return values between 0 and 360 2012-10-03 23:42:30 +02:00
Julius Michaelis 1e9858cf73 Fix C4Real modulo operator 2012-10-03 23:29:01 +02:00
Julius Michaelis 6bfe7f85d7 Merge default -> floating-point 2012-10-03 17:54:24 +02:00
Julius Michaelis fbe8a897cb __m128 alignment sledge hammer workaround: inline assembly
This is still a workaround. It's functionality was determined by testing, and there should still be methods that are broken
2012-10-01 00:13:01 +02:00
Günther Brammer 8156123a26 autotools: Update list of files to compile
Also remove some forgotten files from the repository
2012-05-14 16:40:16 +02:00
Julius Michaelis 2b9a1778b3 Fix some missmerges Guenther pointed out 2012-05-07 22:45:41 +02:00
Julius Michaelis f9410855b6 Add -msse with gcc 2012-05-04 18:55:41 +02:00
Julius Michaelis 03020bc742 Fix file modes 2012-05-04 16:52:38 +02:00
Julius Michaelis a06f0c45e7 Fix include guard 2012-05-04 16:42:41 +02:00
Julius Michaelis 0d805d5985 Fix C4Real modulo operator 2012-05-03 00:15:20 +02:00
Julius Michaelis 633107b292 Fix float parsing: replace strtod with istringstream (so locale can't break anything) and allow floats with no digit in front of the decimal separator 2012-05-02 16:37:57 +02:00
Julius Michaelis 0873a7b612 Adjust all the parameter types! 2012-05-01 13:55:26 +02:00
Julius Michaelis d0efce7c2b Fix C4Value::NumericConversion 2012-05-01 12:58:51 +02:00
Julius Michaelis bd2a4b0059 Add some missing operators to C4Real.h 2012-04-30 23:30:55 +02:00
Julius Michaelis c5ff06547b Update ObjectDistance to floats 2012-04-30 23:28:43 +02:00
Julius Michaelis f73ceb584c Make (Get|Set)((X|Y)Dir|R(Dir)?)|CreateObject|Hit work with floats 2012-04-20 22:59:17 +02:00
Julius Michaelis fcebef6fa1 Fix Pow(const C4Real&, const C4Real&) 2012-04-30 12:01:19 +02:00
Julius Michaelis 81360e959b Merge default->floating-point 2012-05-02 23:18:01 +02:00
Julius Michaelis 8fc27f9231 Add __m128 parameter alignment workaround for msvc
Does not fix problem on all mingw-builds
2012-04-15 01:11:14 +02:00
Julius Michaelis dda2fb17a9 Merge default into floating-point 2012-04-14 11:44:24 +02:00
Julius Michaelis d56843cc9c Update nearly all of the basic/standalone C4Script functions to use C4Numeric/C4Real
Drop ArcSin/ArcCos until someone needs them
2012-03-27 15:13:55 +02:00
Julius Michaelis 7e0a51c0c7 Add num and float type specifiers for function parameters
Also, add C4Real to the template magic for engine script functions
2012-03-27 17:17:15 +02:00
Julius Michaelis a464332ec7 Add convenience class C4Numeric for writing engine script functions 2012-03-27 15:11:33 +02:00
Julius Michaelis bc073f6035 Fix power operator
Forgotten declaration caused conversion to int
2012-03-27 14:58:28 +02:00
Julius Michaelis 6b5d884dbd Implement correct float comparison 2012-03-26 16:24:33 +02:00
Julius Michaelis 548a1047b9 C4Value Arithmetic Assignment Operators: Fix integer operation 64vs32bit consistency
var ov = 0x7fffffff, counter = 0x80000000; while(++counter <= 1) ov++; Format("%v %v", ov, !ov); would return "0 false" on a 64 bit system, exists since CR
2012-03-26 15:22:47 +02:00
Julius Michaelis 9b8cfac66e Implement operator % for floats 2012-03-26 01:48:35 +02:00
Julius Michaelis d3f37e5cfd C4Value: Fix float to boolean conversion (initialize floats correctly on 64 bit systems) 2012-03-26 01:47:45 +02:00
Julius Michaelis c82a71269f Fix C4Object::DoMovement 2012-03-24 13:01:24 +01:00
Julius Michaelis 7e857994d0 Fix C4Value
-Various conversion tables
-Store -0.0 as 0.0
-Operator ==

Fix float parsing

Change operator type check
2012-03-24 13:00:25 +01:00
Julius Michaelis 962b4f0070 Merge default to floating-point 2012-03-22 18:02:48 +01:00
Nicolas Hake 98f6af6125 Drop all fp implementations except for SSE 2011-03-08 18:27:17 +01:00
Nicolas Hake 5e07721a2d Merge default into floating-point 2011-03-08 18:06:10 +01:00
Nicolas Hake 3396ea7a2c Unbreak unary minus for ints (welp) 2011-01-06 22:15:21 +01:00
Nicolas Hake 26914b19cb Make Abs() work on floats 2011-01-06 21:05:15 +01:00
Nicolas Hake 0de08987ec Add tag class to ease writing script functions that take any numeric arg 2011-01-06 21:04:59 +01:00
Nicolas Hake 3af311d675 Fix unary - on fps 2011-01-06 21:03:31 +01:00
Nicolas Hake 3a280bcb4f Removed unneccessary CnvF2I/CnvI2F defs 2011-01-06 19:02:06 +01:00
Nicolas Hake 66e2078b21 Allow exponentiation (** operator) with fp arguments
The operator is implemented by utilizing the equivalence relation of
x**y == exp(y*log(x)). This introduces a non-trivial error, which may
be reduced/eliminated at a later date by implementing a specialized
pow() function.
2011-01-06 18:54:23 +01:00
Nicolas Hake 27b544e778 Use Julien Pommier's SSE vector math functions 2011-01-06 18:51:07 +01:00
Nicolas Hake a858678248 Re-fix numeric parameter coercion 2011-01-06 01:09:59 +01:00
Nicolas Hake 14665880ae Merge default into floating-point 2011-01-06 01:09:04 +01:00
Nicolas Hake ffbe74be89 Merge backed-out changeset 2011-01-06 01:03:38 +01:00
Nicolas Hake f4ac79858b Backed out changeset e06fd6359b15
While the changeset did in fact fix the coercion of numeric function
parameters, it also broke proplist refcounting somewhat badly.
2011-01-06 01:03:02 +01:00
Nicolas Hake 7465fb057a gcc: build fixes 2010-10-04 17:14:32 +02:00
Nicolas Hake c551d67956 Streamline conversion checks 2010-10-04 17:14:22 +02:00
Nicolas Hake c12e4fd937 Fixed numeric function parameter coercion 2010-10-04 14:21:25 +02:00
Nicolas Hake 61627c7a31 Merge default into floating-point 2010-10-04 00:02:39 +02:00
Nicolas Hake 6ad6acee12 SSE: Truncate when converting to int 2010-07-10 19:53:37 +02:00
Nicolas Hake 134f462080 Add int<->float conversion functions 2010-07-10 18:08:26 +02:00
Nicolas Hake 77b9c47cf8 Merge default into floating-point 2010-07-08 03:47:39 +02:00
Nicolas Hake 6938e64cba Add floating point support to C4Value/C4Aul 2010-07-08 03:15:03 +02:00
Nicolas Hake ff2e4e05b0 Check for static_assert support 2010-05-29 14:44:16 +02:00
Nicolas Hake b620bc24cf Check for SSE support on startup 2010-05-19 07:25:07 +02:00
Nicolas Hake e3542d739d C4Real: Implement floating point calculation via SSE
Contrary to x87 FPU floating point calculations, using the SSE unit
should be networking safe, as the internal precision of the SSE unit
is 32 bits when using single precision values. Thus, the compiler's
decision on when to spill registers to memory doesn't influence the
end results of the calculation.

Sine and cosine are calculated using a Taylor approximation after
pulling the input values down to an interval of +-pi/4, with a maximum
relative error of 1.1e-6, or absolute error of 6.0e-8.
2010-05-19 07:25:05 +02:00
Nicolas Hake c71c5f5983 Serialize C4PXS via floats 2010-05-19 07:25:04 +02:00
Nicolas Hake fa59c32429 C4Real: Split into multiple implementations
Each implementation gets their own header and class to separate them.
The class is wrapped by C4Real, a template class with the requested
implementation as template argument. This is to ensure a fixed interface
regardless of the underlying implementation. C4Real expects its template
class to mostly have the same interface as a standard C++ float; differences
are handled by template specialization.
2010-05-19 07:25:01 +02:00
169 changed files with 7140 additions and 24571 deletions

View File

@ -100,6 +100,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if(USE_GCC_STD_0X)
list(APPEND OC_CXX_FLAGS "-std=gnu++0x")
endif()
# isilkor 10-10-04: disable a useless warning
list(APPEND OC_CXX_FLAGS "-Wno-non-template-friend")
endif()
# ck 09-09-20: CMAKE_REQUIRED_FLAGS requires a string, not a list.
@ -145,6 +147,7 @@ if(MSVC_VERSION)
list(APPEND OC_CXX_FLAGS "/wd4267")
endif()
# Add some g++ warnings
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual")
endif()
@ -153,6 +156,12 @@ if(WIN32 AND MINGW)
# Activate DEP and ASLR
list(APPEND OC_EXE_LINKER_FLAGS "-Wl,--nxcompat -Wl,--dynamicbase")
endif()
# Enable SSE with g++/MinGW
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND OC_CXX_FLAGS "-msse")
endif()
############################################################################
# List target source files. Don't directly create a target since we condi-
# tionally add more sources depending on configuration options later.
@ -536,6 +545,8 @@ set(OC_CLONK_SOURCES
src/script/C4Aul.h
src/script/C4AulLink.cpp
src/script/C4AulParse.cpp
src/script/C4Numeric.cpp
src/script/C4Numeric.h
src/script/C4PropList.cpp
src/script/C4PropList.h
src/script/C4Script.cpp
@ -552,6 +563,7 @@ set(OC_CLONK_SOURCES
src/zlib/gzio.c
src/zlib/gzio.h
src/zlib/zutil.h
thirdparty/simdmath/sse_mathfun.h
thirdparty/timsort/sort.h
)
mark_as_advanced(OC_CLONK_SOURCES)
@ -802,6 +814,11 @@ if(NOT Boost_INCLUDE_DIR)
message(SEND_ERROR "Could not find the Boost C++ Libraries")
else()
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES("
#include <boost/type_traits/is_pod.hpp>
struct Pod {}; struct NonPod { NonPod() {} };
int main() { int a[boost::is_pod<Pod>::value * 2 - 1], b[1 - 2 * boost::is_pod<NonPod>::value]; }" HAVE_WORKING_IS_POD)
endif()
include(FindThreads)
@ -980,6 +997,8 @@ add_executable(c4script
src/script/C4AulFunc.cpp
src/script/C4AulLink.cpp
src/script/C4AulParse.cpp
src/script/C4Numeric.cpp
src/script/C4Numeric.h
src/script/C4StringTable.cpp
src/script/C4PropList.cpp
src/script/C4ScriptHost.cpp

View File

@ -503,6 +503,8 @@ src/script/C4AulFunc.h \
src/script/C4Aul.h \
src/script/C4AulLink.cpp \
src/script/C4AulParse.cpp \
src/script/C4Numeric.cpp \
src/script/C4Numeric.h \
src/script/C4PropList.cpp \
src/script/C4PropList.h \
src/script/C4Script.cpp \
@ -516,6 +518,7 @@ src/script/C4Value.cpp \
src/script/C4Value.h \
src/script/C4ValueMap.cpp \
src/script/C4ValueMap.h \
thirdparty/simdmath/sse_mathfun.h \
thirdparty/timsort/sort.h \
thirdparty/tinyxml/tinystr.cpp \
thirdparty/tinyxml/tinystr.h \
@ -697,6 +700,7 @@ src/script/C4AulExec.cpp \
src/script/C4AulFunc.cpp \
src/script/C4AulLink.cpp \
src/script/C4AulParse.cpp \
src/script/C4Numeric.cpp \
src/script/C4StringTable.cpp \
src/script/C4PropList.cpp \
src/script/C4ScriptHost.cpp \

19576
docs/de.po

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
</param>
</params>
</syntax>
<desc>Returns the view angle from the first point to the second in degrees. 0° ist straight up. All coordinates global.</desc>
<desc>Returns the view angle from the first point to the second in degrees. 0° ist straight up. All coordinates global. Always returns zero or positive angles smaller than 360*precision</desc>
<examples>
<example>
<code><funclink>SetR</funclink>(Angle(<funclink>GetCursor</funclink>(0)-><funclink>GetX</funclink>(), <funclink>GetCursor</funclink>(0)-><funclink>GetY</funclink>(),

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE funcs SYSTEM "../../../clonk.dtd">
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>float</title>
<category>Arithmetik</category>
<version>4.10.0.0 OC</version>
<syntax>
<rtype>float</rtype>
<params>
<param><type>int</type><name>i</name><desc>Die Ganzzahl, die in eine Fließkommazahl konvertiert werden soll.</desc></param>
</params>
</syntax>
<desc>Wandelt eine Ganzzahl in eine Fließkommazahl um. Ist der Wert von <em>i</em> nicht exakt darstellbar, wird der darstellbare Wert zurückgegeben, der die geringste Abweichung vom tatsächlichen Wert hat.</desc>
<examples>
<example>
<code>float(2)</code>
<text>Gibt die Zahl 2.0 zurück.</text>
</example>
</examples>
</func>
<related>
<funclink>int</funclink>
<funclink>C4Id</funclink>
</related>
<author>isilkor</author><date>2010-07-10</date>
</funcs>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE funcs SYSTEM "../../../clonk.dtd">
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>int</title>
<category>Arithmetik</category>
<version>4.10.0.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param><type>float</type><name>f</name><desc>Die Fließkommazahl, die in eine Ganzzahl konvertiert werden soll.</desc></param>
</params>
</syntax>
<desc>Wandelt eine Fließkommazahl in eine Ganzzahl um. Dabei werden Nachkommastellen abgeschnitten. Ist der Wert von <em>f</em> außerhalb des Wertebereichs einer vorzeichenbehafteten 32-bit-Ganzzahl, so ist der Rückgabewert <em>nil</em>.</desc>
<examples>
<example>
<code>int(2.5)</code>
<text>Gibt die Zahl 2 zurück.</text>
</example>
</examples>
</func>
<related>
<funclink>float</funclink>
<funclink>C4Id</funclink>
</related>
<author>isilkor</author><date>2010-07-10</date>
</funcs>

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("Frostbolt", nil, 100, 1, nil, GetID(), pClonk->GetOwner(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
Sound("Fireball");

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("HardeningSpell", nil, 100, 1, nil, GetID(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
RemoveObject();

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("WindScrollStorm", nil, 100, 1, nil, GetID(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
RemoveObject();

View File

@ -1,12 +1,12 @@
global func BlueExplode(int level)
global func BlueExplode(num level)
{
// Shake the viewport.
ShakeViewPort(level, GetX(), GetY());
// Sound must be created before object removal, for it to be played at the right position.
var grade = BoundBy(level / 10 - 1, 1, 3);
var grade = BoundBy(Int(level / 10 - 1), 1, 3);
Sound(Format("Blast%d", grade), false);
// Explosion parameters.
@ -26,7 +26,7 @@ global func BlueExplode(int level)
return;
}
global func DoBlueExplosion(int x, int y, int level, object inobj, int cause_plr, object layer)
global func DoBlueExplosion(float x, float y, num level, object inobj, int cause_plr, object layer)
{
// Container to ContainBlast
var container = inobj;
@ -61,7 +61,7 @@ global func DoBlueExplosion(int x, int y, int level, object inobj, int cause_plr
return true;
}
global func BlueExplosionEffect(int level, int x, int y)
global func BlueExplosionEffect(num level, float x, float y)
{
// Blast particle.
CreateParticle("Blast", x, y, 0, 0, level * 10, RGB(0,25,255));
@ -85,7 +85,7 @@ global func BlueExplosionEffect(int level, int x, int y)
return;
}
global func BlastObjectsBlue(int x, int y, int level, object container, int cause_plr, object layer)
global func BlastObjectsBlue(float x, float y, num level, object container, int cause_plr, object layer)
{
var obj;

View File

@ -20,7 +20,7 @@ func FxSparkleTimer(target, effect, effect_time)
return true;
}
public func ControlUse(object clonk, int ix, int iy)
public func ControlUse(object clonk, num ix, num iy)
{
// applies the healing effect even when the Clonk is at full HP
// does this because you can block one source of damage

View File

@ -7,7 +7,7 @@ public func MakeNormalSize() { king_size = false; SetMeshMaterial("wood",0); ret
public func Departure() { MakeNormalSize(); }
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
clonk->DetachMesh(iArrowMesh);
iArrowMesh = nil;

View File

@ -14,7 +14,7 @@ protected func JavelinStrength()
return 14;
}
public func DoThrow(object clonk, int angle)
public func DoThrow(object clonk, float angle)
{
var javelin=TakeObject();
if (king_size)

View File

@ -6,7 +6,7 @@ public func MakeKingSize() { king_size = true; return(SetMeshMaterial("KingMuske
public func MakeNormalSize() { king_size = false; return(SetMeshMaterial("Musket",0)); }
public func Departure() { MakeNormalSize(); }
private func FireWeapon(object clonk, int angle)
private func FireWeapon(object clonk, float angle)
{
var shot = Contents(0)->TakeObject();

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("Fireball", nil, 100, 1, nil, GetID(), pClonk->GetOwner(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
Sound("Fireball");

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
var pos = GetRandomSpawn();
x = pos[0];

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("WindScrollStorm", nil, 100, 1, nil, GetID(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY(), pClonk->GetOwner());
RemoveObject();

View File

@ -52,7 +52,7 @@ protected func Initialize()
PlaceGras();
return;
}
global func FxLifestealDamage(object target, effect, int damage, int cause, int from)
global func FxLifestealDamage(object target, effect, num damage, int cause, int from)
{
var goal = FindObject(Find_ID(KingOfTheHill_Location));
if (!goal) return damage;
@ -198,7 +198,7 @@ global func PlaceGras()
return 1;
}
private func MakeTarget(int x, int y)
private func MakeTarget(float x, float y)
{
var target = CreateObject(DynamiteBox, x, y, NO_OWNER);

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("Fireball", nil, 100, 1, nil, GetID(), pClonk->GetOwner(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
Sound("Fireball");

View File

@ -6,7 +6,7 @@
--*/
public func ControlUse(object pClonk, int ix, int iy)
public func ControlUse(object pClonk, num ix, num iy)
{
AddEffect("WindScrollStorm", nil, 100, 1, nil, GetID(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY(), pClonk->GetOwner());
RemoveObject();

View File

@ -83,7 +83,7 @@ protected func Hit()
DoDrill(0);
}
func DoDrill(int angle)
func DoDrill(float angle)
{
var x = Sin(angle+GetR(), 40);
var y = -Cos(angle+GetR(), 40);

View File

@ -89,7 +89,7 @@ protected func HitObject()
DoFireworks();
}
func Launch(int angle)
func Launch(float angle)
{
SetProperty("Collectible",0);
SetCategory(C4D_Vehicle);
@ -103,7 +103,7 @@ func Launch(int angle)
SetR(angle);
}
func DoFireworks(int speed)
func DoFireworks()
{
RemoveEffect("Flight",this);
Fireworks();

View File

@ -57,7 +57,7 @@ global func FxBoomAttackTimer(object target, effect, int time)
}
}
global func CreateAttackWave(int angle, int rockets, int anglespread)
global func CreateAttackWave(float angle, int rockets, float anglespread)
{
var radius = Min(LandscapeWidth()/2, LandscapeHeight()/2);
var rocket_id = Boomattack;
@ -93,7 +93,7 @@ global func CreateAttackWave(int angle, int rockets, int anglespread)
}
}
func InitializePlayer(int iPlr, int iX, int iY, object pBase, int iTeam)
func InitializePlayer(int iPlr, float iX, float iY, object pBase, int iTeam)
{
SetFoW(false,iPlr);
JoinPlayer(iPlr);

View File

@ -1,5 +1,5 @@
public func Set(int sx, int sy, int ex, int ey) {
public func Set(num sx, num sy, num ex, num ey) {
//SetObjectBlitMode(GFX_BLIT_Additive);
SetAction("Vis");
SetPosition(sx,sy);

View File

@ -15,7 +15,7 @@ func Construction()
aimed = false;
}
func ControlUse(object clonk, int x, int y)
func ControlUse(object clonk, num x, num y)
{
if(!aimed) return false;
@ -28,7 +28,7 @@ func ControlUse(object clonk, int x, int y)
return true;
}
func ControlUseStart(object clonk, int x, int y)
func ControlUseStart(object clonk, num x, num y)
{
if(aimed) return false;
@ -45,14 +45,14 @@ func ControlUseStart(object clonk, int x, int y)
func HoldingEnabled() { return true; }
func ControlUseHolding(object clonk, int x, int y)
func ControlUseHolding(object clonk, num x, num y)
{
if(aimed) return false;
if(vis) vis->Set(sx,sy,x+clonk->GetX(),y+clonk->GetY());
}
func ControlUseStop(object clonk, int x, int y)
func ControlUseStop(object clonk, num x, num y)
{
if(aimed) return false;
@ -81,7 +81,7 @@ public func Destruction()
}
public func Launch(int angle, int str, object shooter)
public func Launch(float angle, num str, object shooter)
{
var xdir = Sin(angle,str);
var ydir = Cos(angle,-str);
@ -93,7 +93,7 @@ public func Launch(int angle, int str, object shooter)
}
public func SetDivert(int x1, int y1, int x2, int y2)
public func SetDivert(num x1, num y1, num x2, num y2)
{
var inflight = GetEffect("InFlight",this);
inflight.ax = x1;
@ -153,7 +153,7 @@ public func FxInFlightTimer(object target, effect, int time)
}
// Returns nil or coordinates of intersection.
global func Intersect(int Ax, int Ay, int Bx, int By, int Px, int Py, int Qx, int Qy)
global func Intersect(num Ax, num Ay, num Bx, num By, num Px, num Py, num Qx, num Qy)
{
var BAx = Bx-Ax;
var BAy = By-Ay;

View File

@ -4,7 +4,7 @@ local tower, rope;
/* Connection */
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
// Search for objects to connect with!
var connect = FindObjects(Find_Category(C4D_Vehicle), Find_AtPoint(), Find_Not(Find_Func("NoLiftTowerConnection")), Find_Not(Find_Func("IsEnvironment")));

View File

@ -137,7 +137,7 @@ func GetHookAngle()
return Angle(particles[-2][0][0], particles[-2][0][1], particles[-3][0][0], particles[-3][0][1])+180;
}
func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
func SetLineTransform(obj, num r, num xoff, num yoff, num length, int layer, int MirrorSegments) {
if(!MirrorSegments) MirrorSegments = 1;
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values

View File

@ -37,7 +37,11 @@ public func Incineration()
return;
}
<<<<<<< local
public func Damage(num change, int byplayer)
=======
public func Damage()
>>>>>>> other
{
if (GetDamage() > (size/4)) Destroy();
}

View File

@ -21,7 +21,7 @@ public func FixTo(object station)
SetCursor(GetOwner(), this, true);
}
public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool repeat, bool release)
public func ObjectControl(int plr, int ctrl, num x, num y, num strength, bool repeat, bool release)
{
if (release) return false;

View File

@ -104,7 +104,7 @@ public func Active()
}
}
func SetLineTransform(int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
func SetLineTransform(num r, num xoff, num yoff, num length, int layer, int MirrorSegments) {
if(!MirrorSegments) MirrorSegments = 1;
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values

View File

@ -10,7 +10,7 @@ public func IsToolProduct() { return true; }
/*-- Line connection --*/
// Use will connect power line to building at the clonk's position.
protected func ControlUse(object clonk, int x, int y)
protected func ControlUse(object clonk, num x, num y)
{
// Is there an object which accepts power lines?
var obj = FindObject(Find_AtPoint(), Find_Func("IsCableCrossing"));

View File

@ -122,7 +122,7 @@ func SerializeObjects(ids)
}
}
func InitializePlayer(int iPlr, int iX, int iY, object pBase, int iTeam)
func InitializePlayer(int iPlr, float iX, float iY, object pBase, int iTeam)
{
JoinPlayer(iPlr);
return;

View File

@ -14,7 +14,7 @@ protected func Initialize()
return;
}
public func SetRestoreObject(object to_restore, object to_container, int to_x, int to_y, int to_r, string ctrl_string)
public func SetRestoreObject(object to_restore, object to_container, float to_x, float to_y, float to_r, string ctrl_string)
{
to_restore->Enter(this);
var effect = AddEffect("Restore", this, 100, 1, this);
@ -143,7 +143,7 @@ protected func FxRestoreStop(object target, effect, int reason, bool temporary)
/*-- Global restoration on destruction --*/
// Adds an effect to restore an item on destruction.
global func AddRestoreMode(object to_container, int to_x, int to_y, int to_r)
global func AddRestoreMode(object to_container, float to_x, float to_y, float to_r)
{
if (!this)
return;

View File

@ -30,7 +30,7 @@ func DoInit(int first_player)
return true;
}
func EnsureObject(id def, int x, int y, int owner)
func EnsureObject(id def, float x, float y, int owner)
{
var obj = FindObject(Find_ID(def));
if (!obj) obj = CreateObject(def,x,y,owner);

View File

@ -308,7 +308,7 @@ func CloseEyes(iCounter)
--*/
/* Walking backwards */
func SetBackwardsSpeed(int value)
func SetBackwardsSpeed(num value)
{
lAnim.backwardsSpeed = value;
UpdateBackwardsSpeed();
@ -392,7 +392,7 @@ func Footstep()
}
func GetWalkAnimationPosition(string anim, int pos)
func GetWalkAnimationPosition(string anim, num pos)
{
var dir = -1;
if(GetDirection() == COMD_Right) dir = +1;
@ -640,7 +640,7 @@ func FxIntScaleRotTimer(target, eff, time)
SetMeshTransformation(Trans_Mul(Trans_Translate(eff.oldX-turnx, eff.oldY-turny), Trans_Rotate(eff.oldR,0,0,1), Trans_Translate(turnx, turny)), 1);
}
func SetScaleRotation (int r, int xoff, int yoff, int rotZ, int turny, int instant) {
func SetScaleRotation (num r, num xoff, num yoff, num rotZ, num turny, bool instant) {
if(r < -180) r += 360;
if(r > 180) r -= 360;
// set matrix values
@ -757,7 +757,7 @@ func FxFallTimer(object target, effect, int timer)
--*/
/* Replaces the named action by an instance with a different speed */
func PushActionSpeed(string action, int n)
func PushActionSpeed(string action, num n)
{
if (ActMap == this.Prototype.ActMap)
ActMap = { Prototype = this.Prototype.ActMap };
@ -767,7 +767,7 @@ func PushActionSpeed(string action, int n)
}
/* Resets the named action to the previous one */
func PopActionSpeed(string action, int n) {
func PopActionSpeed(string action, float n) {
// FIXME: This only works if PushActionSpeed and PopActionSpeed are the only functions manipulating the ActMap
if (this.Action == ActMap[action])
this.Action = ActMap[action].Prototype;
@ -998,7 +998,7 @@ func GetSwimRotation()
When the clonk hits the ground a kneel animation of are roll are performed.
--*/
func Hit(int iXSpeed, int iYSpeed)
func Hit(float iXSpeed, float iYSpeed)
{
if(iYSpeed < 450) return;
if(GetAction() != "Walk") return;
@ -1152,7 +1152,7 @@ func FxIntDigTimer(pTarget, effect, iTime)
// custom throw
public func ControlThrow(object target, int x, int y)
public func ControlThrow(object target, num x, num y)
{
// standard throw after all
if (!x && !y) return false;

View File

@ -1,7 +1,7 @@
/*-- Bubble --*/
global func Bubble(int amount, int x, int y)
global func Bubble(int amount, float x, float y)
{
if (amount==nil || amount==0)
amount=3;

View File

@ -6,7 +6,7 @@ func Initialize()
SetComDir(COMD_None);
}
func Show(int clr, int layer, int size,bool diffuse)
func Show(int clr, int layer, float size,bool diffuse)
{
// where on the z-axis?
// FIXME

View File

@ -15,12 +15,12 @@ global func RemoveTrajectory(object pObj)
}
//pObj = Object which has the trajectory. pObj must be owned by a player for the player to see the trajectory.
//int ix = glogal x coordinate
//int iy = global y coordinate
//int iXDir & int iYDir = velocity of simulated shot
//float ix = glogal x coordinate
//float iy = global y coordinate
//float iXDir & float iYDir = velocity of simulated shot
//int iColor = What colour the trajectory particles are
//int spacing = distance of pixels between each trajectory particle
global func AddTrajectory(object pObj, int iX, int iY, int iXDir, int iYDir, int iColor, int spacing)
global func AddTrajectory(object pObj, float iX, float iY, float iXDir, float iYDir, int iColor, int spacing)
{
// Delete old trajectory
RemoveTrajectory(pObj);

View File

@ -31,7 +31,7 @@ public func SetSize(int to_size)
return;
}
public func SetMoveSpeed(int speed)
public func SetMoveSpeed(num speed)
{
ActMap.Moving.Speed = Max(0, speed);
return;
@ -39,7 +39,7 @@ public func SetMoveSpeed(int speed)
/*-- Horizontal movement --*/
public func MoveHorizontal(int left, int right, int speed)
public func MoveHorizontal(num left, num right, num speed)
{
var effect = AddEffect("MoveHorizontal", this, 100, 1, this);
effect.Left = left;
@ -65,7 +65,7 @@ private func FxMoveHorizontalTimer(object target, proplist effect)
/*-- Vertical movement --*/
public func MoveVertical(int top, int bottom, int speed)
public func MoveVertical(num top, num bottom, num speed)
{
var effect = AddEffect("MoveVertical", this, 100, 1, this);
effect.Top = top;

View File

@ -15,13 +15,13 @@ local strength;
/// \par ydev Maximum deviation from the average vertical speed.
/// \par do_gamma If \c true, the lightning bolt will flash the screen.
/// \returns \c true if the lightning could be launched, \c false otherwise.
global func LaunchLightning(int x, int y, int to_strength, int xdir, int ydir, int xdev, int ydev, bool do_gamma)
global func LaunchLightning(float x, float y, num to_strength, float xdir, float ydir, float xdev, float ydev, bool do_gamma)
{
var lightning = CreateObject(Lightning, x - GetX(), y - GetY());
return lightning && lightning->Launch(x, y, to_strength, xdir, ydir, xdev, ydev, do_gamma);
}
public func Launch(int x, int y, int to_strength, int xdir, int ydir, int xdev, int ydev, bool do_gamma)
public func Launch(float x, float y, num to_strength, float xdir, float ydir, float xdev, float ydev, bool do_gamma)
{
xDir = xdir; yDir = ydir;
xDev = xdev; yDev = ydev;
@ -101,7 +101,7 @@ private func Redraw()
}
}
private func DrawRotatedParticleLine(string particle, int x1, int y1, int x2, int y2, int distance, int sizeFifths, int color)
private func DrawRotatedParticleLine(string particle, float x1, float y1, float x2, float y2, float distance, float sizeFifths, int color)
{
distance = Max(distance, 1);
var angle = Angle(x1, y1, x2, y2);

View File

@ -83,7 +83,7 @@ public func Place(int count)
// Changes the precipitation type of this cloud.
// Also an id call: Changes all clouds to this settings.
public func SetPrecipitation(string mat, int amount)
public func SetPrecipitation(string mat, num amount)
{
// Called to proplist: change all clouds.
if (this == Cloud)
@ -103,7 +103,7 @@ public func SetPrecipitation(string mat, int amount)
// Changes the lightning frequency type of this cloud.
// Also an id call: Changes all clouds to this settings.
public func SetLightning(int freq)
public func SetLightning(num freq)
{
// Called to proplist: change all clouds.
if (this == Cloud)
@ -118,7 +118,7 @@ public func SetLightning(int freq)
return;
}
public func SetRain(int to_rain)
public func SetRain(num to_rain)
{
rain = BoundBy(to_rain, 0, rain_max);
return;

View File

@ -8,7 +8,7 @@
/*-- Disaster Control --*/
public func SetChance(int chance)
public func SetChance(num chance)
{
if (this != Earthquake)
return;

View File

@ -8,7 +8,7 @@
/*-- Disaster Control --*/
public func SetChance(int chance)
public func SetChance(num chance)
{
if (this != Meteor)
return;
@ -45,7 +45,7 @@ protected func FxIntMeteorControlTimer(object target, proplist effect, int time)
return FX_OK;
}
global func LaunchMeteor(int x, int y, int size, int xdir, int ydir)
global func LaunchMeteor(float x, float y, num size, float xdir, float ydir)
{
var meteor = CreateObject(Meteor);
return meteor->Launch(x, y, size, xdir, ydir);
@ -53,7 +53,7 @@ global func LaunchMeteor(int x, int y, int size, int xdir, int ydir)
/*-- Meteor --*/
public func Launch(int x, int y, int size, int xdir, int ydir)
public func Launch(float x, float y, num size, float xdir, float ydir)
{
// Launch from indicated position.
SetPosition(x, y);
@ -113,7 +113,7 @@ protected func FxIntMeteorTimer()
return 1;
}
protected func Hit(int xdir, int ydir)
protected func Hit(float xdir, float ydir)
{
var size = 10 + GetCon();
var speed2 = 20 + (xdir ** 2 + ydir ** 2) / 10000;

View File

@ -8,7 +8,7 @@
/*-- Disaster Control --*/
public func SetChance(int chance)
public func SetChance(num chance)
{
if (this != Volcano)
return;
@ -54,7 +54,7 @@ protected func FxIntVolcanoControlTimer(object target, proplist effect, int time
return FX_OK;
}
global func LaunchVolcano(int x, int y, int strength, string material, int angle)
global func LaunchVolcano(int x, int y, int strength, string material, float angle)
{
var volcano = CreateObject(Volcano);
return volcano->Launch(x, y, strength, material, angle);
@ -68,7 +68,7 @@ local angle; // Direction of the volcano.
local oldx, oldy; // Old coordinates.
// returns true on a succesful volcano launch, false otherwise.
public func Launch(int x, int y, int strength, string material, int angle)
public func Launch(int x, int y, int strength, string material, float angle)
{
// Initial coordinates of the volcano.
SetPosition(x, y);

View File

@ -39,7 +39,7 @@ private func GetScoreGoal()
return 1;
}
public func SetFlagBase(int team, int x, int y)
public func SetFlagBase(int team, float x, float y)
{
var base = CreateObject(Goal_FlagBase, x, y, NO_OWNER);
base->SetTeam(team);
@ -72,7 +72,7 @@ private func EliminateOthers(int win_team)
return;
}
protected func InitializePlayer(int plr, int x, int y, object base, int team)
protected func InitializePlayer(int plr, num x, num y, object base, int team)
{
// Join new clonk.
JoinPlayer(plr);

View File

@ -93,7 +93,7 @@ private func FxIntAreaMonteCarloTimer()
}
// Returns whether the point (x,y) is covered by a flagpole.
private func CoveredByFlag(int x, int y)
private func CoveredByFlag(num x, num y)
{
for (var flag in FindObjects(Find_Func("IsFlagpole"), Sort_Distance(x - GetX(), y - GetY())))
if (Distance(flag->GetX(), flag->GetY(), x, y) < flag->GetFlagRadius())

View File

@ -107,7 +107,7 @@ public func GetRadius()
return radius;
}
public func SetRadius(int to)
public func SetRadius(num to)
{
radius=to;
}
@ -120,7 +120,7 @@ func DoPoint(int player, int count)
Scoreboard->SetPlayerData(player, "koth", player_points[player]);
}
protected func InitializePlayer(int plr, int x, int y, object base, int team)
protected func InitializePlayer(int plr, num x, num y, object base, int team)
{
Scoreboard->NewPlayerEntry(plr);
player_suicides[plr]=0;

View File

@ -18,7 +18,7 @@ func MakeHostileToAll(int newplr, int team)
}
}
protected func InitializePlayer(int newplr, int x, int y, object base, int team)
protected func InitializePlayer(int newplr, num x, num y, object base, int team)
{
MakeHostileToAll(newplr, team);
return inherited(newplr, x, y, base, team, ...);

View File

@ -73,7 +73,7 @@ public func GetCPNumber() { return cp_num; }
/*-- Checkpoint size --*/
local cp_size;
public func SetCPSize(int size)
public func SetCPSize(num size)
{
cp_size = BoundBy(size, 10, 100);
return;
@ -289,7 +289,7 @@ protected func UpdateGraphics(int time)
return;
}
protected func GetColorByAngle(int angle)
protected func GetColorByAngle(float angle)
{
// Get cleared count.
var cnt = 0;

View File

@ -48,7 +48,7 @@ protected func Initialize()
/*-- Checkpoint creation --*/
public func SetStartpoint(int x, int y)
public func SetStartpoint(float x, float y)
{
// Safety, x and y inside landscape bounds.
x = BoundBy(x, 0, LandscapeWidth());
@ -63,7 +63,7 @@ public func SetStartpoint(int x, int y)
return cp;
}
public func SetFinishpoint(int x, int y, bool team)
public func SetFinishpoint(float x, float y, bool team)
{
// Safety, x and y inside landscape bounds.
x = BoundBy(x, 0, LandscapeWidth());
@ -82,7 +82,7 @@ public func SetFinishpoint(int x, int y, bool team)
return cp;
}
public func AddCheckpoint(int x, int y, int mode)
public func AddCheckpoint(float x, float y, int mode)
{
// Safety, x and y inside landscape bounds.
x = BoundBy(x, 0, LandscapeWidth());
@ -305,7 +305,7 @@ private func IsWinner(int plr)
/*-- Player section --*/
protected func InitializePlayer(int plr, int x, int y, object base, int team)
protected func InitializePlayer(int plr, num x, num y, object base, int team)
{
// If the parkour is already finished, then immediately eliminate player.
if (finished)

View File

@ -559,7 +559,7 @@ private func MoveObjects(proplist p_source, proplist p_target, object menuItem,
/* Interface to menu item as commander_object */
public func OnMouseClick(int x, int y, bool alt)
public func OnMouseClick(num x, num y, bool alt)
{
// Close menu if not clicked on one of the menus.
var menu = FindObject(Find_Distance(160, x, y), Find_ID(GUI_CircleMenu));

View File

@ -362,7 +362,7 @@ public func OnMouseOut(int plr)
SetGraphics(nil, nil);
}
public func FxGUIHealthMonitorDamage(object target, proplist effect, int damage, int cause)
public func FxGUIHealthMonitorDamage(object target, proplist effect, num damage, int cause)
{
var change = Abs(damage)/(target->GetMaxEnergy()*10);

View File

@ -134,7 +134,7 @@ public func GetSymbol()
}
// Sets the menu item size.
public func SetSize(int size)
public func SetSize(num size)
{
// The menu item size is handled over con since drag&drop needs to scale the same.
SetCon(size);

View File

@ -105,7 +105,7 @@ func Set(to, angle, offset, visibility, size)
this.Visibility = visibility;
}
func Rotate (int r, int xoff, int yoff, size) {
func Rotate (num r, num xoff, num yoff, size) {
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
size = size ?? 1000;
// set matrix values
@ -113,4 +113,4 @@ func Rotate (int r, int xoff, int yoff, size) {
(+fcos) * size / 1000, (+fsin) * size / 1000, ((1000-fcos)*xoff - fsin*yoff) * size / 1000,
(-fsin) * size / 1000, (+fcos) * size / 1000, ((1000-fcos)*yoff + fsin*xoff) * size / 1000
);
}
}

View File

@ -182,7 +182,7 @@ func AttachTargetLost()
return RemoveObject();
}
func Rotate (int r, int xoff, int yoff) {
func Rotate (num r, num xoff, num yoff) {
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values
SetObjDrawTransform (

View File

@ -108,7 +108,7 @@ public func AddItem(new_item, int amount, extra)
}
// selects by dx,dy and alt=alternative selection
func OnMouseClick(int dx, int dy, bool alt)
func OnMouseClick(num dx, num dy, bool alt)
{
var item_count=GetLength(menu_icons);
if(!item_count)
@ -162,7 +162,7 @@ func Show()
shown = true;
}
public func UpdateCursor(int dx, int dy)
public func UpdateCursor(num dx, num dy)
{
if(shown)
{

View File

@ -33,7 +33,7 @@ func SetMessage(m)
Update();
}
func FadeOut(int speed, step)
func FadeOut(num speed, step)
{
if(step==nil)step=1;
var e=AddEffect("FadeOut", this, 1, speed, this);
@ -49,7 +49,7 @@ func FxFadeOutTimer(target, effect)
}
func SetColor(int r2, g2, b2, a)
func SetColor(int r2, int g2, int b2, int a)
{
r=r2;
g=g2;

View File

@ -10,7 +10,7 @@
self-explanatory
scenario callbacks:
func GetSparkItem(int x, int y)
func GetSparkItem(float x, float y)
returns the item ID one spark should spawn.
called at the creation of the sparks (x=nil, y=nil) for mirrored sparks and on Hit() again, if it returned nil before
@ -26,7 +26,7 @@
local toSpawn;
global func StartItemSparks(int rate, bool mirror)
global func StartItemSparks(num rate, bool mirror)
{
AddEffect("GlobalItemSparks", nil, 1, 5, nil, nil, rate, mirror);
}
@ -187,4 +187,4 @@ func Hit()
{
if(GetEffect("Off", this)) return SetSpeed();
DoSpawn();
}
}

View File

@ -7,7 +7,7 @@ protected func Hit()
/* Eating */
protected func ControlUse(object clonk, int iX, int iY)
protected func ControlUse(object clonk, num iX, num iY)
{
clonk->Eat(this);
}

View File

@ -7,7 +7,7 @@ func Hit()
/* Eating */
protected func ControlUse(object clonk, int iX, int iY)
protected func ControlUse(object clonk, num iX, num iY)
{
clonk->Eat(this);
}

View File

@ -8,7 +8,7 @@ protected func Hit()
/* Eating */
protected func ControlUse(object clonk, int iX, int iY)
protected func ControlUse(object clonk, num iX, num iY)
{
clonk->Eat(this);
}

View File

@ -16,7 +16,7 @@ func Hit()
}
// Item activation
func ControlUseStart(object clonk, int x, int y)
func ControlUseStart(object clonk, num x, num y)
{
// Clonk must stand on ground. Allow during SCALE; but Clonk won't keep animation if he's not actually near the ground
var clnk_proc = clonk->GetProcedure();
@ -39,7 +39,7 @@ func ControlUseStart(object clonk, int x, int y)
func HoldingEnabled() { return true; }
func FxIntBridgeStart(object clonk, proplist effect, int temp, int x, int y)
func FxIntBridgeStart(object clonk, proplist effect, int temp, num x, num y)
{
if (temp)
return FX_OK;
@ -119,7 +119,7 @@ func FxIntBridgeTimer(object clonk, proplist effect, int time)
return FX_OK;
}
func ControlUseHolding(object clonk, int new_x, int new_y)
func ControlUseHolding(object clonk, num new_x, num new_y)
{
var effect = GetEffect("IntBridge", clonk);
if (!effect)
@ -130,13 +130,13 @@ func ControlUseHolding(object clonk, int new_x, int new_y)
return true;
}
public func ControlUseStop(object clonk, int x, int y)
public func ControlUseStop(object clonk, num x, num y)
{
LoamDone(clonk);
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
public func ControlUseCancel(object clonk, num x, num y)
{
LoamDone(clonk);
return true;

View File

@ -20,7 +20,7 @@ func Initialize()
AddEffect("MossMoisture",this,100,36,this);
}
public func ControlUse(object clonk, int x, int y, bool box)
public func ControlUse(object clonk, num x, num y, bool box)
{
if(!clonk->~IsWalking()) return true;
// Search for ground

View File

@ -5,7 +5,7 @@
For planting wheat or to get flour
*/
public func ControlUse(object clonk, int x, int y, bool box)
public func ControlUse(object clonk, num x, num y, bool box)
{
if(clonk->GetAction() != "Walk") return true;
// Search for ground

View File

@ -17,7 +17,7 @@ local magic_number;
static const axe_swing_time = 30;
private func Hit(int x, int y)
private func Hit(num x, num y)
{
StonyObjectHit(x,y);
return 1;
@ -45,7 +45,7 @@ public func GetCarrySpecial(clonk)
return carry_bone;
}
public func ControlUseStart(object clonk, int iX, int iY)
public func ControlUseStart(object clonk, num iX, num iY)
{
// Can clonk use the axe?
if (!clonk->IsWalking() && !clonk->IsJumping())
@ -152,7 +152,7 @@ public func ControlUseStart(object clonk, int iX, int iY)
protected func HoldingEnabled() { return GetEffect("IntAxe", this); }
func ControlUseHolding(object clonk, int new_x, int new_y)
func ControlUseHolding(object clonk, num new_x, num new_y)
{
// Can clonk use axe?
if (!clonk->IsWalking() || GetXDir() != 0)
@ -267,13 +267,13 @@ func FxIntSplitStop(object clonk, effect, int temp)
if (this->Contained() == clonk) Reset(clonk);
}
func ControlUseStop(object clonk, int ix, int iy)
func ControlUseStop(object clonk, num ix, num iy)
{
Reset(clonk);
return true;
}
protected func ControlUseCancel(object clonk, int ix, int iy)
protected func ControlUseCancel(object clonk, num ix, num iy)
{
Reset(clonk);
return true;

View File

@ -2,7 +2,7 @@
local user;
func ControlUseStart(object clonk, int ix, int iy)
func ControlUseStart(object clonk, num ix, num iy)
{
if(GBackSolid(0,15) || GBackLiquid(0,15) || clonk->GetActionTarget() != nil) return 1;
var balloon = CreateObject(BalloonDeployed,0,5);

View File

@ -91,7 +91,7 @@ private func FillBarrel(string szMat)
szLiquid = szMat;
}
private func EmptyBarrel(int angle, int strength, object clonk)
private func EmptyBarrel(float angle, int strength, object clonk)
{
if (!angle)
angle = 0;
@ -118,7 +118,7 @@ private func UpdateBarrel()
return;
}
public func ControlUse(object clonk, int iX, int iY)
public func ControlUse(object clonk, num iX, num iY)
{
var AimAngle = Angle(0, 0, iX, iY);
if (iVolume >= 1)

View File

@ -82,13 +82,13 @@ func ControlJump(object clonk)
return true;
}
func ControlUseStart(object clonk, int x, int y)
func ControlUseStart(object clonk, num x, num y)
{
// forward control to item
if(clonk->GetProcedure()=="ATTACH") return false;
}
func ControlUse(object clonk, int x, int y)
func ControlUse(object clonk, num x, num y)
{
// forward control to item
if(clonk->GetProcedure()=="ATTACH") return false;
@ -138,7 +138,7 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime)
fuel--;
}
private func JumpOff(object clonk, int speed)
private func JumpOff(object clonk, float speed)
{
rider = nil;
@ -191,7 +191,7 @@ public func OnUnmount(clonk)
return true;
}
func Launch(int angle, object clonk)
func Launch(float angle, object clonk)
{
SetProperty("Collectible",0);
SetCategory(C4D_Vehicle);
@ -236,7 +236,7 @@ func SetFuel(int new)
fuel = new;
}
func SetDirectionDeviation(int new)
func SetDirectionDeviation(num new)
{
dirdev = new;
}

View File

@ -18,7 +18,7 @@ public func GetCarryTransform()
return Trans_Mul(Trans_Rotate(-90, 0, 0, 1), Trans_Translate(-4000,3500));
}
public func ControlUseStart(object clonk, int iX, int iY)
public func ControlUseStart(object clonk, num iX, num iY)
{
// Can clonk use the bucket?
if (!clonk->IsWalking() && !clonk->IsJumping())
@ -84,7 +84,7 @@ public func ControlUseStart(object clonk, int iX, int iY)
return true;
}
private func Spill(int x, int y, bool soft_spill)
private func Spill(num x, num y, bool soft_spill)
{
// This will only spray out the material because no solid base to stick it on was found
if (soft_spill)

View File

@ -7,7 +7,7 @@
*/
public func ControlUse(object clonk, int x, int y, bool box)
public func ControlUse(object clonk, num x, num y, bool box)
{
// if already activated, nothing (so, throw)
if(GetAction() == "Fuse" || box)
@ -50,7 +50,7 @@ public func ControlUse(object clonk, int x, int y, bool box)
return false;
}
private func Place(object clonk, int x, int y, bool box)
private func Place(object clonk, num x, num y, bool box)
{
var angle = Angle(0,0,x,y);
var pos = GetWall(angle);

View File

@ -18,7 +18,7 @@ local fIgnite;
local aDynamites;
local aWires;
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
if(clonk->GetAction() != "Walk") return true;

View File

@ -34,7 +34,7 @@ local aWires;
local pWire;
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
var pDyna = aDynamites[iCount-1] = CreateContents(Dynamite);
if(!pDyna->ControlUse(clonk, x, y, 1))

View File

@ -24,7 +24,7 @@ public func New(object new_clonk, object new_rope)
rope = new_rope;
}
public func Launch(int angle, int str, object shooter, object bow)
public func Launch(float angle, num str, object shooter, object bow)
{
SetObjDrawTransform(0, 1, 0, 0, 0, 0, 0); // Hide
Exit();
@ -342,7 +342,7 @@ public func FxIntGrappleControlTimer(object target, fxnum, int time)
return FX_OK;
}
global func Trans_RotX(int rotation, int ox, int oy)
global func Trans_RotX(num rotation, num ox, num oy)
{
return Trans_Mul(Trans_Translate(-ox, -oy), Trans_Rotate(rotation,0,0,1), Trans_Translate(ox, oy));
}

View File

@ -96,7 +96,7 @@ public func MaxLengthReached()
}
/* for swinging */
func DoSpeed(int value)
func DoSpeed(num value)
{
var speed = particles[-1][0][0]-particles[-1][1][0];
if(speed*value > 0) value += speed/10;
@ -241,7 +241,7 @@ func GetClonkOff()
return Vec_Sub(particles[-1][0],last_point);
}
func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
func SetLineTransform(obj, num r, num xoff, num yoff, num length, int layer, int MirrorSegments) {
if(!MirrorSegments) MirrorSegments = 1;
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values

View File

@ -83,7 +83,7 @@ protected func Departure()
public func GetAnimationSet() { return animation_set; }
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
// Cut rope, or otherwise remove helper object.
if (hook->Contained() != this)
@ -121,7 +121,7 @@ public func FinishedLoading(object clonk)
}
// Update the angle on mouse movement
public func ControlUseHolding(object clonk, int x, int y)
public func ControlUseHolding(object clonk, num x, num y)
{
// Save new angle
var angle = Angle(0,0,x,y);
@ -136,14 +136,14 @@ public func ControlUseHolding(object clonk, int x, int y)
}
// Stopping says the clonk to stop with aiming (he will go on untill he has finished loading and aiming at the given angle)
public func ControlUseStop(object clonk, int x, int y)
public func ControlUseStop(object clonk, num x, num y)
{
clonk->StopAim();
return true;
}
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
DetachMesh(hook_attach);
hook_attach = nil;
@ -159,7 +159,7 @@ public func FinishedAiming(object clonk, int angle)
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
public func ControlUseCancel(object clonk, num x, num y)
{
clonk->CancelAiming();
return true;

View File

@ -38,7 +38,7 @@ private func Hit(x, y)
static const Pickaxe_SwingTime = 40;
func ControlUseStart(object clonk, int ix, int iy)
func ControlUseStart(object clonk, num ix, num iy)
{
// Can clonk use pickaxe?
if (clonk->GetProcedure() != "WALK")
@ -57,7 +57,7 @@ func ControlUseStart(object clonk, int ix, int iy)
protected func HoldingEnabled() { return true; }
func ControlUseHolding(object clonk, int new_x, int new_y)
func ControlUseHolding(object clonk, num new_x, num new_y)
{
// Can clonk use pickaxe?
if (clonk->GetProcedure() != "WALK")
@ -72,13 +72,13 @@ func ControlUseHolding(object clonk, int new_x, int new_y)
local x, y;
func ControlUseStop(object clonk, int ix, int iy)
func ControlUseStop(object clonk, num ix, num iy)
{
Reset(clonk);
return true;
}
protected func DoSwing(object clonk, int ix, int iy)
protected func DoSwing(object clonk, float ix, float iy)
{
var angle = Angle(0,0,ix,iy);
@ -151,7 +151,7 @@ func FxIntPickaxeTimer(clonk, effect, time)
clonk->SetYDir(Cos(angle,-speed),100);
}
protected func ControlUseCancel(object clonk, int ix, int iy)
protected func ControlUseCancel(object clonk, num ix, num iy)
{
Reset(clonk);
return true;

View File

@ -12,7 +12,7 @@ public func IsToolProduct() { return true; }
/*-- Line connection --*/
// Called with double dig: will connect power line to building at the clonk's position.
protected func ControlUse(object clonk, int x, int y)
protected func ControlUse(object clonk, num x, num y)
{
// Is this already connected to a liquid pump?
if (FindObject(Find_PipeLine()))

View File

@ -213,7 +213,7 @@ static const Ropebridge_Anchor_RightYOffset = 0;
static const Ropebridge_Anchor_LeftXOffset = -150;
static const Ropebridge_Anchor_LeftYOffset = -100;
func GetRopeConnetPosition(int index, bool fRight, bool fEnd, int angle, int oldangle)
func GetRopeConnetPosition(int index, bool fRight, bool fEnd, float angle, int oldangle)
{
var SegmentOffset = [[Ropebridge_Segment_LeftXOffset, Ropebridge_Segment_LeftYOffset],
[Ropebridge_Segment_RightXOffset, Ropebridge_Segment_RightYOffset]];
@ -236,7 +236,7 @@ func GetRopeConnetPosition(int index, bool fRight, bool fEnd, int angle, int old
return point;
}
func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
func SetLineTransform(obj, num r, num xoff, num yoff, num length, int layer, int MirrorSegments) {
if(!MirrorSegments) MirrorSegments = 1;
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values

View File

@ -5,7 +5,7 @@
local master, index;
local angle;
public func SetAngle(int new_angle) { angle = new_angle; }
public func SetAngle(num new_angle) { angle = new_angle; }
public func SetMaster(new_master, new_index) { master = new_master; index = new_index; }

View File

@ -34,7 +34,7 @@ local ParticleCount;
local grabber;
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
if(!clonk->GetContact(-1)) return true;
// Unroll dir
@ -338,7 +338,7 @@ func UpdateLines()
static const Ropeladder_Segment_LeftXOffset = 200;
static const Ropeladder_Segment_RightXOffset = -100;
func GetRopeConnetPosition(int index, bool fRight, bool fEnd, int angle, int oldangle)
func GetRopeConnetPosition(int index, bool fRight, bool fEnd, float angle, int oldangle)
{
if(SwitchRopes && index == 1 && fEnd == 0) fRight = !fRight;
if(!(index == 1 && fEnd == 0) && MirrorSegments == -1) fRight = !fRight;
@ -396,7 +396,7 @@ func GetRopeConnetPosition(int index, bool fRight, bool fEnd, int angle, int old
}
}
func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
func SetLineTransform(obj, num r, num xoff, num yoff, num length, int layer, int MirrorSegments) {
if(!MirrorSegments) MirrorSegments = 1;
var fsin=Sin(r, 1000), fcos=Cos(r, 1000);
// set matrix values

View File

@ -16,7 +16,7 @@ local DigX, DigY;
public func IsDigging() { return fDigging; }
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
AddEffect("ShovelDig",clonk,1,1,this);
// ControlUseHolding(clonk, x, y);
@ -31,7 +31,7 @@ public func ControlUseStart(object clonk, int x, int y)
public func HoldingEnabled() { return true; }
public func ControlUseHolding(object clonk, int x, int y)
public func ControlUseHolding(object clonk, num x, num y)
{
DigX = x;
DigY = y;
@ -40,12 +40,12 @@ public func ControlUseHolding(object clonk, int x, int y)
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
public func ControlUseCancel(object clonk, num x, num y)
{
ControlUseStop(clonk, x, y);
}
public func ControlUseStop(object clonk, int x, int y)
public func ControlUseStop(object clonk, num x, num y)
{
fDigging = 0;
RemoveEffect("ShovelDig",clonk);
@ -108,7 +108,7 @@ public func FxShovelDigTimer(object clonk, effect, int time)
if(fDigging)
{
// Adjust speed at current animation position
var speed = clonk.ActMap.Dig.Speed*2;
var speed = clonk.ActMap.Dig.Speed*2.0;
var iAnimation = GetEffect("IntDig", clonk).var1;
var iPosition = clonk->GetAnimationPosition(iAnimation)*180/clonk->GetAnimationLength("Dig");

View File

@ -88,7 +88,7 @@ private func EndUsage(object clonk)
}
// Update the glove aim angle
private func UpdateGloveAngle(object clonk, int x, int y)
private func UpdateGloveAngle(object clonk, num x, num y)
{
var angle=Normalize(Angle(0,0, x,y),-180);
angle=BoundBy(angle,-150,150);
@ -238,7 +238,7 @@ protected func ControlUseStop(object clonk, ix, iy)
return 1;
}
protected func ControlUseCancel(object clonk, int ix, int iy)
protected func ControlUseCancel(object clonk, num ix, num iy)
{
CancelUse(clonk);
}

View File

@ -21,7 +21,7 @@ protected func Construction()
return _inherited(...);
}
public func Launch(int angle, int str, object shooter)
public func Launch(float angle, num str, object shooter)
{
//SetGraphics(0, HelpArrow);
SetShape(-2, -2, 4, 11);

View File

@ -54,7 +54,7 @@ func Initialize()
public func GetAnimationSet() { return animation_set; }
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
// if the clonk doesn't have an action where he can use it's hands do nothing
if(!clonk->HasHandAction())
@ -110,7 +110,7 @@ public func FinishedLoading(object clonk)
}
// Update the angle on mouse movement
public func ControlUseHolding(object clonk, int x, int y)
public func ControlUseHolding(object clonk, num x, num y)
{
// Save new angle
var angle = Angle(0,0,x,y);
@ -125,14 +125,14 @@ public func ControlUseHolding(object clonk, int x, int y)
}
// Stopping says the clonk to stop with aiming (he will go on untill he has finished loading and aiming at the given angle)
public func ControlUseStop(object clonk, int x, int y)
public func ControlUseStop(object clonk, num x, num y)
{
clonk->StopAim();
return true;
}
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
clonk->DetachMesh(iArrowMesh);
iArrowMesh = nil;
@ -155,7 +155,7 @@ public func FinishedAiming(object clonk, int angle)
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
public func ControlUseCancel(object clonk, num x, num y)
{
clonk->CancelAiming(this);
return true;
@ -188,7 +188,7 @@ public func Reset(clonk)
/* ++++++++ Helper functions ++++++++ */
private func ClonkAimLimit(object clonk, int angle)
private func ClonkAimLimit(object clonk, float angle)
{
angle = Normalize(angle,-180);
if(Abs(angle) > 160) return false;

View File

@ -65,7 +65,7 @@ public func HoldingEnabled() { return true; }
local fAiming;
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
if(clonk->GetHandPosByItemPos(clonk->GetItemPos(this)) == 0)
ClubChangeHandAnims("R");
@ -104,7 +104,7 @@ public func ControlUseStop(object clonk, ix, iy)
}
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
clonk->StartShoot(this);
@ -117,7 +117,7 @@ public func FinishedAiming(object clonk, int angle)
return true;
}
protected func ControlUseCancel(object clonk, int x, int y)
protected func ControlUseCancel(object clonk, num x, num y)
{
clonk->CancelAiming(this);
return true;
@ -129,7 +129,7 @@ public func Reset(clonk)
}
// Called in the half of the shoot animation (when ShootTime2 is over)
public func DuringShoot(object clonk, int angle)
public func DuringShoot(object clonk, float angle)
{
// called only once. We don't want it only once..
// DoStrike(clonk, angle);

View File

@ -6,7 +6,7 @@
*/
public func ControlUse(object clonk, int x, int y, bool box)
public func ControlUse(object clonk, num x, num y, bool box)
{
// if already activated, nothing (so, throw)
if(GetEffect("FuseBurn", this))

View File

@ -34,7 +34,7 @@ public func GetCarryBone() { return "Javelin"; }
public func GetCarrySpecial(clonk) { if(fAiming > 0) return "pos_hand2"; }
public func GetCarryTransform() { if(fAiming == 1) return Trans_Rotate(180, 1, 0, 0); }
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
// if the clonk doesn't have an action where he can use it's hands do nothing
if(!clonk->HasHandAction())
@ -70,13 +70,13 @@ protected func ControlUseStop(object clonk, ix, iy)
}
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
clonk->StartShoot(this);
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
public func ControlUseCancel(object clonk, num x, num y)
{
clonk->CancelAiming(this);
return true;
@ -88,12 +88,12 @@ public func Reset(clonk)
}
// Called in the half of the shoot animation (when ShootTime2 is over)
public func DuringShoot(object clonk, int angle)
public func DuringShoot(object clonk, float angle)
{
DoThrow(clonk, angle);
}
public func DoThrow(object clonk, int angle)
public func DoThrow(object clonk, float angle)
{
var javelin=TakeObject();

View File

@ -23,7 +23,7 @@ protected func Hit()
}
}
public func Launch(object shooter, int angle, int dist, int speed)
public func Launch(object shooter, float angle, num dist, num speed)
{
SetController(shooter->GetController());
AddEffect("HitCheck", this, 1,1, nil,nil, shooter);

View File

@ -6,7 +6,7 @@
that it looks like it because the trail itself is only drawn straight.
Any projectile can use the trail by calling (after creating it):
Set(int width, int length, object projectile)
Set(num width, num length, object projectile)
while width is the width of the trail, length the length of the trail and
projectile itself. The trail will be removed when the projectile is gone.
@ -16,7 +16,7 @@
local fRemove, iSpeed, pShot, w, l, r, x, y;
public func Set(int iWidth, int iLength, object pSht)
public func Set(num iWidth, num iLength, object pSht)
{
pShot = pSht;

View File

@ -60,7 +60,7 @@ local MuskUp; local MuskFront; local MuskDown; local MuskOffset;
protected func HoldingEnabled() { return true; }
func ControlUseStart(object clonk, int x, int y)
func ControlUseStart(object clonk, num x, num y)
{
// if the clonk doesn't have an action where he can use it's hands do nothing
if(!clonk->HasHandAction())
@ -129,7 +129,7 @@ protected func ControlUseStop(object clonk, ix, iy)
}
// Callback from the clonk, when he actually has stopped aiming
public func FinishedAiming(object clonk, int angle)
public func FinishedAiming(object clonk, float angle)
{
if(!loaded) return;
@ -140,7 +140,7 @@ public func FinishedAiming(object clonk, int angle)
return true;
}
protected func ControlUseCancel(object clonk, int x, int y)
protected func ControlUseCancel(object clonk, num x, num y)
{
clonk->CancelAiming(this);
return true;
@ -151,7 +151,7 @@ public func Reset(clonk)
fAiming = 0;
}
private func FireWeapon(object clonk, int angle)
private func FireWeapon(object clonk, float angle)
{
var shot = Contents(0)->TakeObject();
shot->Launch(clonk,angle,iBarrel,200);

View File

@ -11,7 +11,7 @@ local solid_mask_helper;
/* Usage callbacks */
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
// may only be used while walking
if(!clonk->HasHandAction() || !clonk->IsWalking() || !CanStrikeWithWeapon(clonk))
@ -26,7 +26,7 @@ public func ControlUseStart(object clonk, int x, int y)
return true;
}
public func ControlUseHolding(object clonk, int x, int y)
public func ControlUseHolding(object clonk, num x, num y)
{
UpdateShieldAngle(clonk, x, y);
}
@ -104,7 +104,7 @@ private func EndUsage(object clonk)
}
// Update the shield angle
private func UpdateShieldAngle(object clonk, int x, int y)
private func UpdateShieldAngle(object clonk, num x, num y)
{
var angle=Normalize(Angle(0,0, x,y),-180);
angle=BoundBy(angle,-150,150);

View File

@ -26,7 +26,7 @@ public func GetCarryTransform(clonk, sec, back)
local magic_number;
local carry_bone;
public func ControlUse(object clonk, int x, int y)
public func ControlUse(object clonk, num x, num y)
{
// cooldown?
if(!CanStrikeWithWeapon(clonk)) return true;
@ -164,7 +164,7 @@ func WeaponStrikeExpired()
}
func SwordDamage(int shield)
func SwordDamage(num shield)
{
return ((100-shield)*9*1000 / 100);
}

View File

@ -34,10 +34,10 @@
GetAnimationSet(); // Has to return the animation set
// The following Stop* Callbacks, have to return true if the clonk doesn't have to be reset (e.g. stating aiming after loading)
FinishedLoading(object clonk); // When the loading animation is over (after LoadTime frames)
FinishedAiming(object clonk, int angle); // When the clonk has finished loading and aiming at the disired position
FinishedShooting(object clonk, int angle); // When the shooting animation is over (after ShootTime frames)
FinishedAiming(object clonk, float angle); // When the clonk has finished loading and aiming at the disired position
FinishedShooting(object clonk, float angle); // When the shooting animation is over (after ShootTime frames)
DuringLoad(object clonk); // LoadTime2 frames after load start
DuringShoot(object clonk, int angle); // ShootTime2 frames after shoot start
DuringShoot(object clonk, float angle); // ShootTime2 frames after shoot start
// When the clonk has during aiming an action where he can't use his hands, the aiming is paused
OnPauseAim(object clonk); // Callback when the clonk has to pause the aiming
OnRestartAim(object clonk);// Callback when the clonk want's to restart aiming. Has to return true if aiming again is possible
@ -46,7 +46,7 @@
The Weapon can use the following functions on the clonk:
StartLoad(object weapon); // The weapon wants to start loading (e.g. on ControlUseStart)
StartAim(object weapon); // The weapon wants to switch in aim mode (e.g. after loading on StopLoad)
SetAimPosition(int angle); // The weapon specifies a new angle (e.g. on ControlUseHolding)
SetAimPosition(float angle); // The weapon specifies a new angle (e.g. on ControlUseHolding)
StopAim(); // The weapon wants to shoot (e.g. on ControlUseStop) BUT: the stop is just scheduled! The clonk finished loading or aiming and then really stops aiming!
StartShoot(object weapon); // The weapon wants to start the shoot animation (e.g. on StopAim)
@ -242,7 +242,7 @@ public func StopLoad()
ResetHands();
}
public func StartAim(object weapon, int angle)
public func StartAim(object weapon, float angle)
{
// only if we aren't adjusted to this weapon already
if(weapon != aim_weapon)
@ -309,7 +309,7 @@ func FxIntAimTimer(target, effect, time)
}
}
public func SetAimPosition(int angle)
public func SetAimPosition(float angle)
{
// Save angle
aim_angle = angle;

View File

@ -13,7 +13,7 @@
///Function must be called from vehicle context
///param x,y,w,h = target rectangle to look for objects in to follow the vehicle's rotation
func AlignObjectsToRotation(object turnTarget, int x, int y, int w, int h)
func AlignObjectsToRotation(object turnTarget, num x, num y, num w, num h)
{
if(!this) FatalError("Function AlignToRotation must be called from object (vehicle) context");
if(!turnTarget) FatalError("Function requires a valid turnTarget to get rotation value from");
@ -173,4 +173,4 @@ private func FxAlignRotationStop(object target, proplist effect)
//Get rid of the floor helper object
if(effect.floorHelper) effect.floorHelper->RemoveObject();
}
}

View File

@ -20,7 +20,7 @@ protected func Construction()
layer = CreateArray();
}
public func SetBarOffset(int x, int y, int num)
public func SetBarOffset(num x, num y, int num)
{
offsx[num] = x;
offsy[num] = y;
@ -43,13 +43,13 @@ public func SetBarLayers(int la, int num)
SetGraphics("Bar",Library_Bars,layer[num]+1,GFXOV_MODE_Base);
}
public func SetBarDimensions(int wdt, int hgt, int num)
public func SetBarDimensions(num wdt, num hgt, int num)
{
width[num] = 1000 * wdt / Library_Bars->GetDefWidth();
height[num] = 1000 * hgt / Library_Bars->GetDefHeight();
}
public func SetBarProgress(int promille, int num)
public func SetBarProgress(num promille, int num)
{
// not existing
if(GetLength(layer) <= num) return false;

View File

@ -140,7 +140,7 @@ public func IsAiming()
return aiming;
}
public func Aim(int ctrl, object clonk, int strength, int repeat, int release)
public func Aim(int ctrl, object clonk, num strength, int repeat, int release)
{
// start (stealth) aiming
if(!GetEffect("Move",this))

View File

@ -734,7 +734,7 @@ local virtual_cursor;
local noholdingcallbacks;
/* Main control function */
public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool repeat, bool release)
public func ObjectControl(int plr, int ctrl, num x, num y, num strength, bool repeat, bool release)
{
if (!this)
return false;
@ -1187,7 +1187,7 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
return false;
}
public func ObjectControlMovement(int plr, int ctrl, int strength, bool release)
public func ObjectControlMovement(int plr, int ctrl, num strength, bool release)
{
// from PlayerControl.c
var result = inherited(plr,ctrl,strength,release,...);
@ -1208,7 +1208,7 @@ public func ObjectControlMovement(int plr, int ctrl, int strength, bool release)
return result;
}
public func ObjectCommand(string command, object target, int tx, int ty, object target2)
public func ObjectCommand(string command, object target, num tx, num ty, object target2)
{
// special control for throw and jump
// but only with controls, not with general commands
@ -1269,7 +1269,7 @@ private func GetUseCallString(string action) {
return Format("~%sUse%s%s",control,estr,action);
}
private func StartUseControl(int ctrl, int x, int y, object obj)
private func StartUseControl(int ctrl, num x, num y, object obj)
{
using = obj;
using_type = DetermineUsageType(obj);
@ -1314,7 +1314,7 @@ private func StartUseDelayedControl(int ctrl, object obj)
return handled;
}
private func CancelUseControl(int x, int y)
private func CancelUseControl(num x, num y)
{
// to horse first (if there is one)
var horse = GetActionTarget();
@ -1324,7 +1324,7 @@ private func CancelUseControl(int x, int y)
return StopUseControl(x, y, using, true);
}
private func StopUseControl(int x, int y, object obj, bool cancel)
private func StopUseControl(num x, num y, object obj, bool cancel)
{
var stop = "Stop";
if (cancel) stop = "Cancel";
@ -1353,7 +1353,7 @@ private func StopUseControl(int x, int y, object obj, bool cancel)
return handled;
}
private func HoldingUseControl(int ctrl, int x, int y, object obj)
private func HoldingUseControl(int ctrl, num x, num y, object obj)
{
var mex = x;
var mey = y;
@ -1430,7 +1430,7 @@ private func StopUseDelayedControl(object obj)
/* Control to menu */
private func Control2Menu(int ctrl, int x, int y, int strength, bool repeat, bool release)
private func Control2Menu(int ctrl, num x, num y, num strength, bool repeat, bool release)
{
/* all this stuff is already done on a higher layer - in playercontrol.c
@ -1460,7 +1460,7 @@ private func Control2Menu(int ctrl, int x, int y, int strength, bool repeat, boo
}
// Control use redirected to script
private func ControlUse2Script(int ctrl, int x, int y, int strength, bool repeat, bool release, object obj)
private func ControlUse2Script(int ctrl, num x, num y, num strength, bool repeat, bool release, object obj)
{
// click on secondary cancels primary and the other way round
if (using)
@ -1517,7 +1517,7 @@ private func ControlUse2Script(int ctrl, int x, int y, int strength, bool repeat
}
// Control use redirected to script
private func ControlMovement2Script(int ctrl, int x, int y, int strength, bool repeat, bool release, object obj)
private func ControlMovement2Script(int ctrl, num x, num y, num strength, bool repeat, bool release, object obj)
{
// overloads of movement commandos
if (ctrl == CON_Left || ctrl == CON_Right || ctrl == CON_Down || ctrl == CON_Up || ctrl == CON_Jump)
@ -1861,7 +1861,7 @@ func Selected(object mnu, object mnu_item, bool alt)
/* +++++++++++++++ Throwing, jumping +++++++++++++++ */
// Throwing
private func DoThrow(object obj, int angle)
private func DoThrow(object obj, float angle)
{
// parameters...
var iX, iY, iR, iXDir, iYDir, iRDir;
@ -1889,7 +1889,7 @@ private func DoThrow(object obj, int angle)
}
// custom throw
public func ControlThrow(object target, int x, int y)
public func ControlThrow(object target, num x, num y)
{
// standard throw after all
if (!x && !y) return false;

View File

@ -120,7 +120,7 @@ public func HasCommander(object producer)
/* Callbacks from the menu items, to be translated into commands for the producer. */
// Called when a click outside the menu has been made.
public func OnMouseClick(int x, int y, bool alt)
public func OnMouseClick(num x, num y, bool alt)
{
// Close menu if not clicked on the menu.
if (Distance(x, y, 0, 0) > 160)

View File

@ -84,7 +84,7 @@ func AdjustPreview(bool look_up, bool no_call)
// Positions the preview according to the mouse cursor, calls AdjustPreview afterwards
// x and y are refined mouse coordinates so always centered at the clonk
func Reposition(int x, int y)
func Reposition(float x, float y)
{
x = BoundBy(x, -dimension_x/2, dimension_x/2);
y = BoundBy(y, -dimension_y/2, dimension_y/2);

View File

@ -9,7 +9,7 @@
public func IsConstructor() { return true; }
public func ControlUseStart(object clonk, int x, int y)
public func ControlUseStart(object clonk, num x, num y)
{
// Is the clonk able to construct?
if(clonk->GetProcedure() != "WALK")
@ -37,7 +37,7 @@ public func ControlUseStart(object clonk, int x, int y)
public func HoldingEnabled() { return true; }
public func ControlUseHolding(object clonk, int x, int y)
public func ControlUseHolding(object clonk, num x, num y)
{
// Is the clonk still able to construct?
if (clonk->GetProcedure() != "WALK")
@ -112,7 +112,7 @@ func FxControlConstructionPreviewStart(object clonk, effect, int temp, id struct
}
// Called by Control2Effect
func FxControlConstructionPreviewControl(object clonk, effect, int ctrl, int x, int y, int strength, bool repeat, bool release)
func FxControlConstructionPreviewControl(object clonk, effect, int ctrl, num x, num y, num strength, bool repeat, bool release)
{
if (ctrl != CON_Aim)
{
@ -151,7 +151,7 @@ func FxControlConstructionPreviewStop(object clonk, effect, int reason, bool tem
/* Construction */
func CreateConstructionSite(object clonk, id structure_id, int x, int y, int dir, object stick_to)
func CreateConstructionSite(object clonk, id structure_id, num x, num y, int dir, object stick_to)
{
// Only when the clonk is standing and outdoors
if (clonk->GetAction() != "Walk")

Some files were not shown because too many files have changed in this diff Show More