You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rob <geo...@us...> - 2006-01-29 18:34:06
|
Update of /cvsroot/timewarp/source/ppiships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30604/source/ppiships Modified Files: shpalabo.cpp Log Message: Index: shpalabo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ppiships/shpalabo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpalabo.cpp 29 Jan 2006 16:14:34 -0000 1.1 --- shpalabo.cpp 29 Jan 2006 18:33:58 -0000 1.2 *************** *** 176,180 **** { if ((!ship->exists()) || (!ship->fire_weapon)) { - ship = NULL; active = true; } --- 176,179 ---- *************** *** 213,217 **** { // however, do not detonate if you're still too close to your own ship ... ! if (distance(ship) > blast_range) { damage(this, 9999); --- 212,216 ---- { // however, do not detonate if you're still too close to your own ship ... ! if (ship && distance(ship) > proximity_range) { damage(this, 9999); |
Update of /cvsroot/timewarp/ships/ppi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30465/ships/ppi Modified Files: shpalabo.ini shpchmba.ini shpfrebo.ini shpostor.ini shpsacda.ini shpscain.ini shpstrgu.ini shptauhu.ini shputwde.ini Log Message: Index: shpalabo.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpalabo.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpalabo.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpalabo.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 1,4 **** [Info] ! TWCost = 10 Name1 = (PPI) Alary Name2 = Bomber --- 1,4 ---- [Info] ! TWCost = 8 Name1 = (PPI) Alary Name2 = Bomber *************** *** 23,30 **** RechargeRate = 9 ! WeaponDrain = 5 WeaponRate = 6 ! SpecialDrain = 3 SpecialRate = 0 --- 23,30 ---- RechargeRate = 9 ! WeaponDrain = 8 WeaponRate = 6 ! SpecialDrain = 2 SpecialRate = 0 *************** *** 33,41 **** --- 33,48 ---- [Bomb] + Lifetime = 5 + + # the bomb won't explode if it's in this proximity range Proximity = 5 + + # deal damage to everything in this range BlastRange = 6 + # damage at edge DamageMin = 1 + # damage at center DamageMax = 3 Index: shptauhu.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shptauhu.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shptauhu.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shptauhu.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 8,15 **** [Ship] Crew = 26 CrewMax = 26 ! Batt = 36 BattMax = 28 SpeedMax = 28 AccelRate = 7 --- 8,18 ---- [Ship] + Crew = 26 CrewMax = 26 ! ! Batt = 28 BattMax = 28 + SpeedMax = 28 AccelRate = 7 *************** *** 22,26 **** WeaponRate = 1 ! SpecialDrain = 10 SpecialRate = 16 --- 25,29 ---- WeaponRate = 1 ! SpecialDrain = 8 SpecialRate = 16 Index: shpsacda.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpsacda.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpsacda.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpsacda.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 31,40 **** [Weapon] ! Range = 7 Damage = 1 FrameCount = 50 [Special] ! Range = 15 Velocity = 90 Damage = 2 --- 31,40 ---- [Weapon] ! Range = 6 Damage = 1 FrameCount = 50 [Special] ! Range = 12 Velocity = 90 Damage = 2 Index: shpostor.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpostor.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpostor.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpostor.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 1,5 **** [Info] ! SC1Cost = 10 ! SC2Cost = 10 TWCost = 10 Name1 = (PPI) Ostok --- 1,5 ---- [Info] ! SC1Cost = 18 ! SC2Cost = 18 TWCost = 10 Name1 = (PPI) Ostok Index: shputwde.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shputwde.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shputwde.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shputwde.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 1,5 **** [Info] Origin = TWb ! TWCost = 20 Name1 = (PPI) Utwig Name2 = Defender --- 1,5 ---- [Info] Origin = TWb ! TWCost = 16 Name1 = (PPI) Utwig Name2 = Defender *************** *** 25,29 **** WeaponRate = 10 ! SpecialDrain = 6 SpecialRate = 10 --- 25,29 ---- WeaponRate = 10 ! SpecialDrain = 10 SpecialRate = 10 *************** *** 57,61 **** Frames = 20000 ; how long are the personal shields of the crew active: ! Timer = 4.0 [AI3_Default] --- 57,61 ---- Frames = 20000 ; how long are the personal shields of the crew active: ! Timer = 10.0 [AI3_Default] Index: shpfrebo.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpfrebo.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpfrebo.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpfrebo.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 8,13 **** [Ship] ! Crew = 18 ! CrewMax = 18 Batt = 14 BattMax = 14 --- 8,13 ---- [Ship] ! Crew = 14 ! CrewMax = 14 Batt = 14 BattMax = 14 Index: shpstrgu.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpstrgu.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpstrgu.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpstrgu.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 16,20 **** SpeedMax = 26 ! AccelRate = 5 TurnRate = 3 --- 16,20 ---- SpeedMax = 26 ! AccelRate = 7 TurnRate = 3 Index: shpchmba.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpchmba.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpchmba.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpchmba.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 21,25 **** RechargeRate = 6 ! WeaponDrain = 6 WeaponRate = 3 --- 21,25 ---- RechargeRate = 6 ! WeaponDrain = 5 WeaponRate = 3 Index: shpscain.ini =================================================================== RCS file: /cvsroot/timewarp/ships/ppi/shpscain.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpscain.ini 29 Jan 2006 16:27:43 -0000 1.1 --- shpscain.ini 29 Jan 2006 18:33:18 -0000 1.2 *************** *** 1,5 **** [Info] Origin = TWb ! TWCost = 16 Name1 = (PPI) Scavenger Name2 = Interloper --- 1,5 ---- [Info] Origin = TWb ! TWCost = 23 Name1 = (PPI) Scavenger Name2 = Interloper |
Update of /cvsroot/timewarp/ships/ppi/shptauhu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18494/ships/ppi/shptauhu Added Files: content.ini extra_01.wav panel_01.bmp panel_02.bmp panel_03.bmp panel_04.bmp panel_05.bmp panel_06.bmp panel_07.bmp ship_00.bmp shot_a0000.bmp shot_a0001.bmp shot_a0002.bmp shot_a0003.bmp shot_a0004.bmp shot_a0005.bmp shot_a0006.bmp shot_a0007.bmp shot_a0008.bmp shot_a0009.bmp shot_a0010.bmp shot_a0011.bmp shot_a0012.bmp shot_a0013.bmp shot_a0014.bmp shot_a0015.bmp shot_a0016.bmp shot_a0017.bmp shot_a0018.bmp shot_a0019.bmp shot_c0_0000.bmp shot_c0_0001.bmp shot_c0_0002.bmp shot_c0_0003.bmp shot_c0_0004.bmp shot_c0_0005.bmp shot_c0_0006.bmp shot_c0_0007.bmp shot_c0_0008.bmp shot_c0_0009.bmp shot_c0_0010.bmp shot_c0_0011.bmp shot_c0_0012.bmp shot_c0_0013.bmp shot_c0_0014.bmp shot_c0_0015.bmp shot_c0_0016.bmp shot_c0_0017.bmp shot_c0_0018.bmp shot_c0_0019.bmp shot_c0_0020.bmp shot_c0_0021.bmp shot_c0_0022.bmp shot_c0_0023.bmp shot_c0_0024.bmp shot_c0_0025.bmp shot_c0_0026.bmp shot_c0_0027.bmp shot_c0_0028.bmp shot_c0_0029.bmp shot_c0_0030.bmp shot_c0_0031.bmp shot_c0_0032.bmp shot_c0_0033.bmp shot_c0_0034.bmp shot_c0_0035.bmp shot_c0_0036.bmp shot_c0_0037.bmp shot_c0_0038.bmp shot_c0_0039.bmp special_01.wav vict7.jgm weapon_01.wav Log Message: --- NEW FILE: shot_c0_0033.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0015.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0037.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0000.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0030.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0004.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0010.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0027.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0022.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0035.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0005.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0007.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0003.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0011.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0011.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0018.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0015.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vict7.jgm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0014.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_00.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0016.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0006.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0008.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: weapon_01.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0021.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0019.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: content.ini --- [Objects] PanelBitmaps = panel_ 7 ShipSprites = ship_ 1 +r WeaponSprites = shot_a00 20 WeaponExplosion = SpecialSprites = shot_c0_00 40 +alpha SpecialExplosion = ExtraSprites = ExtraExplosion = Ditty = vict7.jgm WeaponSamples = weapon_ 1 SpecialSamples = special_ 1 ExtraSamples = extra_ 1 --- NEW FILE: shot_c0_0036.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0012.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0008.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0038.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0020.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0012.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0024.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0013.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0039.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0023.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0017.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0003.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0034.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0018.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0031.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_07.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: extra_01.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0026.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0017.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0016.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0005.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0002.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0001.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0006.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0009.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0002.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0029.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0013.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0010.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0001.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0032.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a0014.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0025.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0000.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0009.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0028.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0004.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0019.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_c0_0007.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: special_01.wav --- (This appears to be a binary file; contents omitted.) |
From: Rob <geo...@us...> - 2006-01-29 16:30:35
|
Update of /cvsroot/timewarp/ships/ppi/shpscain In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18205/ships/ppi/shpscain Added Files: victory.jgm weapon_01.wav Log Message: --- NEW FILE: victory.jgm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: weapon_01.wav --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/timewarp/ships/ppi/shpscain In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15656/ships/ppi/shpscain Added Files: SHIP_P00.bmp SHIP_P01.bmp SHIP_P02.bmp SHIP_P03.bmp SHIP_P04.bmp SHIP_P05.bmp SHIP_P06.bmp bullet_01.bmp content.ini exp_01.bmp exp_02.bmp exp_03.bmp exp_04.bmp exp_05.bmp exp_06.bmp exp_07.bmp exp_08.bmp exp_09.bmp exp_10.bmp ship_01.bmp special_01.bmp special_01.wav special_02.wav Log Message: --- NEW FILE: SHIP_P01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: special_02.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_08.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bullet_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: special_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: content.ini --- [Objects] ShipSprites = ship_ 1 +r WeaponSprites = bullet_ 1 +r WeaponExplosion = exp_ 10 SpecialSprites = special_ 1 +r SpecialExplosion = ExtraSprites = ExtraSamples = ExtraExplosion = PanelBitmaps = SHIP_P 7 Ditty = victory.jgm WeaponSamples = weapon_ 1 SpecialSamples = special_ 2 --- NEW FILE: exp_05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_09.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SHIP_P00.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_10.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_07.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: exp_04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: special_01.wav --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/timewarp/ships/ppi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15656/ships/ppi Added Files: alleg40.dll dat.exe extract.bat shpalabo.ini shpchmba.dat shpchmba.ini shpfrebo.dat shpfrebo.ini shpfweav.dat shpfweav.ini shpgluse.dat shpgluse.ini shpostor.dat shpostor.ini shpsacda.dat shpsacda.ini shpscain.ini shpsefna.dat shpsefna.ini shpstrgu.dat shpstrgu.ini shptauhu.ini shputwde.dat shputwde.ini Log Message: --- NEW FILE: shpalabo.ini --- [Info] TWCost = 10 Name1 = (PPI) Alary Name2 = Bomber Origin = TWb Coders = Tau Code = AlaryBomber [Ship] Crew = 16 CrewMax = 16 Batt = 20 BattMax = 20 SpeedMax = 30 AccelRate = 10 TurnRate = 4 RechargeAmount = 1 RechargeRate = 9 WeaponDrain = 5 WeaponRate = 6 SpecialDrain = 3 SpecialRate = 0 HotspotRate = 2 Mass = 11.5 [Bomb] Lifetime = 5 Proximity = 5 BlastRange = 6 DamageMin = 1 DamageMax = 3 Armour = 3 Kick = 120 [Afterburn] SpeedMax = 52 AccelRate = 30 --- NEW FILE: shpostor.ini --- [Info] SC1Cost = 10 SC2Cost = 10 TWCost = 10 Name1 = (PPI) Ostok Name2 = Orion Origin = TWb OriginalIdea = Baltar2002 Coders = JadtheGerbil Code = OstokOrion [Ship] Crew = 18 CrewMax = 18 Batt = 10 BattMax = 10 TurnRate = 3 SpeedMax = 8 AccelRate = 35 RechargeAmount = 1 RechargeRate = 5 WeaponDrain = 6 WeaponRate = 10 SpecialDrain = 5 SpecialRate = 5 HotspotRate = 7 Mass = 17 [Weapon] Velocity1 = 4.0 Damage1 = 1 Damage2 = 1 Armour1 = 1 Armour2 = 1 ReleaseAngle1 = 70 ReleaseAngle2 = 290 AngleIncrement = 10 FramesToIgnition = 200 FramesOfThrust = 600 FramesOfCoasting = 1050 AccelRate = 15 MaxSpeed = 75 HotspotRate = 0.5 Mass = 2 OrderedIgnition = 0 ;OrderedIgnition is if the missles fire ; in the order they were fired (1) ; or all at once (0) Wiggle = 1 ;Wiggle controls if the missles "wiggle" in space ; 1 on / 0 off [Special] ; actually, TBS is +5 fast ; due to distance TopBoostSpeed = 70 ExplodeDist = 2 Velocity = 20 Lifetime = 1 BlastRange = 6 Damage = 5 Armour = 3 Kick = 60 SafeAngle = 50 [AI3_Default] Weapon = Forward Weapon_Range = 30 Special = Defense Special2 = Mine Special3= Launched SpecialFreq = 2 --- NEW FILE: extract.bat --- rem Use as: extract.bat shpalabo rem that will extract shpalabo.dat to shpalabo/ mkdir %1 dat.exe -e -o %1/ %1.dat * --- NEW FILE: shputwde.ini --- [Info] Origin = TWb TWCost = 20 Name1 = (PPI) Utwig Name2 = Defender Coders = Varith GFX = Tau SFX = Tau Code = UtwigDefender [Ship] Crew = 16 CrewMax = 16 Batt = 20 BattMax = 20 SpeedMax = 36 AccelRate = 10 TurnRate = 2 RechargeAmount = 1 RechargeRate = 7 WeaponDrain = 4 WeaponRate = 10 SpecialDrain = 6 SpecialRate = 10 HotspotRate = 4 Mass = 14 # this is a rather annoying feature... it's # nicer if you can have thrust at all times. MinBattForThrust = 0 InverseLights = 0 [Weapon] RangeMin = 10 RangeMax = 60 VelocityMin = 65 VelocityMax = 95 Relativity = 0.0 DamageMin = 2 DamageMax = 6 ArmourMin = 4 ArmourMax = 8 Recoil = 0 RecoilMaxSpeed = 10 [Special] Velocity = 18 ; crew are present till 20 seconds after their release Frames = 20000 ; how long are the personal shields of the crew active: Timer = 4.0 [AI3_Default] Weapon = Narrow Weapon_Range = 10 Special = Defense --- NEW FILE: shpchmba.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpsefna.ini --- [Info] Origin = TWb SC1Cost = 10 SC2Cost = 10 TWCost = 10 Name1 = (PPI) Sefy Name2 = Nautilus Coders = GeomanNL-Jad Code = SefyNautilus2 [Ship] Crew = 16 CrewMax = 16 Batt = 20 BattMax = 20 ; even slower than a vux: SpeedMax = 25 AccelRate = 3 TurnRate = 2.0 RechargeAmount = 1 RechargeRate = 5 WeaponDrain = 1 WeaponRate = 1 SpecialDrain = 3 SpecialRate = 15 HotspotRate = 1 Mass = 10 [Weapon] MaxDamage = 1 MinDamage = 1 [Arms] ArmMaxAngle = 100 ; in degree OpenArmTime = 1.0 ; in seconds SnapArmTime = 0.13 ; difference between the two determines the number of snaps you'll get [Special] RelVelocity = 1.0 ; how long it exists, in seconds LifeTime = 30.0 ; delay for unrolling 1 node of the rope (50 nodes for full length) ;Delay = 0.25 Delay = 0.10 OscFreq = 25.0 SegLength = 0.1 ; no problem if this is small Armour = 5.0 ;SprConst = 500.0 SprConst = 650.0 SnagAsteroids = 1 ;250.0 [AI3_Default] Weapon_Range = 5 Weapon = Precedence WeaponRel = 0.0 Special_Range = 30 Special = Narrow SpecialRel = 0.0 [Names] NumNames = 16 CaptName1 = Archi CaptName2 = Melio CaptName3 = Sanary CaptName4 = Sentinel CaptName5 = Bluob CaptName6 = Squidy CaptName7 = Teril CaptName8 = Mollus CaptName9 = Lonsi CaptName10 = Nutal CaptName11 = Beval CaptName12 = Ofcina CaptName13 = Cephalo CaptName14 = Loli CaptName15 = Peal CaptName16 = Oopse --- NEW FILE: shptauhu.ini --- [Info] Origin = TWb TWCost = 22 Name1 = (PPI) Tau Name2 = Hunter Coders = Tau Code = TauHunter [Ship] Crew = 26 CrewMax = 26 Batt = 36 BattMax = 28 SpeedMax = 28 AccelRate = 7 TurnRate = 2 RechargeAmount = 1 RechargeRate = 1 WeaponDrain = 4 WeaponRate = 1 SpecialDrain = 10 SpecialRate = 16 HotspotRate = 4 Mass = 18 [Weapon] Range = 16 Velocity = 130 Length = 10 Spread = 0 Alternating = 0 Number = 1 Damage = 1 Relativity = 0.0 RechargeDelay = 0 [Special] Range = 4.0 Velocity = 90 Damage = 0 Armour = 4 RechargeDelay = 0 [Extra] Velocity = 54 Drain = 4 ExitVelocityFactor = 1.0 CriticalAngle = 30 CriticalRange = 40 FrameTime = 25 RechargeDelay = 0 --- NEW FILE: shpsacda.ini --- [Info] TWCost = 15 Name1 = (PPI) Sacree Name2 = Dagger Origin = TWb Coders = Tau Code = SacreeDagger [Ship] Crew = 8 CrewMax = 8 Batt = 10 BattMax = 10 SpeedMax = 55 AccelRate = 15 TurnRate = 1 RechargeAmount = 1 RechargeRate = 1 WeaponDrain = 2 WeaponRate = 1 SpecialDrain = 10 SpecialRate = 4 HotspotRate = 1 Mass = 6 [Weapon] Range = 7 Damage = 1 FrameCount = 50 [Special] Range = 15 Velocity = 90 Damage = 2 Armour = 3 Recoil = 40 --- NEW FILE: shpstrgu.ini --- [Info] Origin = TWb TWCost = 11 Name1 = (PPI) Strivanar Name2 = Gunner Coders = orz, CyHawk GFX = Forevian Code = StrivanarGunner [Ship] Crew = 16 CrewMax = 16 Batt = 18 BattMax = 18 SpeedMax = 26 AccelRate = 5 TurnRate = 3 RechargeAmount = 1 RechargeRate = 2 WeaponDrain = 4 WeaponRate = 5 SpecialDrain = 10 SpecialRate = 25 HotspotRate = 2 Mass = 13 [Weapon] Range = 13 Velocity = 75 Damage = 1 Armour = 1 Angle = 5 TmpExplodeRate = 3 [Special] # you should also be able to hide behind Armour = 12 Number = 6 ExplosionSpeed = 0.75 [Names] NumNames = 4 CaptName1 = Gogh CaptName2 = Apple CaptName3 = Rembrandt CaptName4 = DaVinci [AI3_Default] Special = Max_Battery --- NEW FILE: shpfrebo.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpgluse.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpsacda.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: alleg40.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpfweav.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shputwde.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpchmba.ini --- [Info] TWCost = 30 Name1 = (PPI) Chmmr Name2 = Battleship Origin = Twb Coders = Tau Code = ChmmrBattleship [Ship] Crew = 32 CrewMax = 32 Batt = 40 BattMax = 40 SpeedMax = 30 AccelRate = 5 TurnRate = 5 RechargeAmount = 1 RechargeRate = 6 WeaponDrain = 6 WeaponRate = 3 SpecialDrain = 2 SpecialRate = 40 HotspotRate = 5 Mass = 21 [Weapon] Range = 34 Velocity = 100 Damage = 2 Armour = 2 [Special] Range = 10 Damage = 4 Angle = 75 Frames = 1000 Aim = 20 Spread = 20 [Extra] VisibilityPoints = 1.0 InvisibilityFactor = 0.5 RangeFactor = 1.0 ShipsOnly = 0 [Names] NumNames = 9 CaptName1 = Jikidra CaptName2 = Mrgrol CaptName3 = Yxchra CaptName4 = Hordofgol CaptName5 = Kjyrn CaptName6 = Jio-Endre CaptName7 = N'krelx CaptName8 = Kjyrn CaptName9 = Jio-Endre [AI3_Default] Weapon = Front Weapon = Narrow Special = Defense Special2 = Field SpecialFreq = 1 StartAngle = -185 EndAngle = -5 StartRange = 3 EndRange = 8 Time = 1200 Damage = 1 Sustain = 125 ; position of the laser DX = -40 ;-5 DY = -34 ;-35 [AI3_Default] ;Tactic = Direct ;Weapon = Narrow Weapon_Range = 55 Special = No_Front Special2 = Field ;Special3 = Precedence Special3 = Defense SpecialFreq = 3 Special_Range = 4.0 [Names] NumNames = 3 CaptName1 = Ben CaptName2 = Grod CaptName3 = Jerry --- NEW FILE: shpgluse.ini --- [Info] TWCost = 23 Name1 = (PPI) Gluta Name2 = Sensor Origin = TWb Coders = Corona688 Code = GlutaSensor [Ship] Crew = 18 CrewMax = 18 Batt = 6 BattMax = 6 SpeedMax = 50 AccelRate = 5 TurnRate = 2 RechargeAmount = 2 RechargeRate = 13 WeaponDrain = 3 WeaponRate = 4 SpecialDrain = 6 SpecialRate = 6 HotspotRate = 0 Mass = 22 [Weapon] Range = 35 Velocity = 100 Damage = 1 Armour = 2 TurnRate = 2 [Special] Fan = 60 Range = 16 Velocity = 85 Markers = 7 Armor = 2 Frames = 15000 Lifespan = 15000 SoundRate = 1000 MaxTargets = 3 Mode = 1 Multi = 0 [AI3_Default] Weapon = Homing Weapon2 = Plus_Special Weapon3 = Precedence Special = Proximity Special2 = Front [Names] NumNames = 3 CaptName1 = N'ssrel CaptName2 = Osselus CaptName3 = Vissyrn --- NEW FILE: shpsefna.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpostor.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpfweav.ini --- [Info] TWCost = 6 Name1 = (PPI) Fweiks Name2 = Avian Origin = TWb Coders = GeomanNL Graphics = GeomanNL Code = FweiksAvian [Ship] Crew = 6 CrewMax = 6 Batt = 4 BattMax = 4 SpeedMax = 52 AccelRate = 20 TurnRate = 4 RechargeAmount = 1 RechargeRate = 5 WeaponDrain = 2 WeaponRate = 2 SpecialDrain = 4 SpecialRate = 7 HotspotRate = 5 Mass = 24 [Weapon] Time = 2.0 Velocity = 80 Damage = 1 Armour = 1 [Special] Time = 10.0 Velocity = 40 Damage = 1 Armour = 1 [Names] NumNames = 1 CaptName1 = c'Gegner [AI3_Default] Weapon = Narrow Weapon1 = Front Special = Mine Weapon_Range = 30 WeaponRel = 0 Tactic = Range Tactic_Min = 15 Tactic_Max = 30 --- NEW FILE: dat.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpstrgu.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpfrebo.ini --- [Info] TWCost = 19 Name1 = (PPI) Frein Name2 = Boomerang Origin = TWb Coders = Launchpad Code = FreinBoomerang [Ship] Crew = 18 CrewMax = 18 Batt = 14 BattMax = 14 SpeedMax = 49 AccelRate = 6 TurnRate = 2 RechargeAmount = 2 RechargeRate = 6 WeaponDrain = 0 WeaponRate = 2 SpecialDrain = 1 SpecialRate = 6 HotspotRate = 5 Mass = 14 [WeaponS] Range = 12 Turn = 1 Velocity = 70 Drain = 2 Damage = 1 Rate = 2 Armour = 1 [WeaponM] Range = 30 Turn = 3 Velocity = 80 Drain = 6 Damage = 3 Rate = 10 Armour = 3 [WeaponL] Range = 1 Turn = 2 Velocity = 120 Drain = 10 Damage = 6 Rate = 8 Armour = 6 [AI3_Default] Weapon_Range = 18 Weapon = Precedence Special_Range = 18 Special_Timer = 100 Special = No_Proximity Special2 = Reserve_Battery Special3 = Next_State BattRecharge = 2 [AI3_Default2] Weapon_Range = 30 Weapon = Precedence Special_Range = 28 Special_Timer = 100 Special = No_Proximity Special2 = Reserve_Battery Special3 = Next_State BattRecharge = 2 [AI3_Default3] Weapon_Velocity = 120 Weapon_Range = 30 Weapon = No_range Weapon2 = Launched Weapon3 = Precedence WeaponRel = 1 Special_Range = 25 Special_Timer = 100 Special = Proximity Special2 = Reserve_Battery Special3 = Reset_State BattRecharge = 2 --- NEW FILE: shpscain.ini --- [Info] Origin = TWb TWCost = 16 Name1 = (PPI) Scavenger Name2 = Interloper Coders = Carlsson Code = ScavengerInterloper [Ship] Crew = 8 CrewMax = 8 Batt = 10 BattMax = 10 SpeedMax = 17 AccelRate = 8 TurnRate = 2 RechargeAmount = 1 RechargeRate = 4 WeaponDrain = 8 WeaponRate = 1 SpecialDrain = 10 SpecialRate = 2 HotspotRate = 0 Mass = 10 [Weapon] Range = 40 Velocity = 200 Damage = 2 Armour = 1 [Special] Range = 60 Velocity = 50 Damage = 1 Armour = 2 # delay between aim-seek, in ms. SkipperPeriod = 500 # visible for this many ms during seek VisiblePeriod = 100 #max angle change (degrees) MaxAngle = 45 [Quirk] maxsparktime = 2000 Rmax = 75 [AI3_Default] Tactic = Range Tactic_Min = 30 Tactic_Max = 60 Weapon = Narrow Special = Homing Special2 = Front [Names] NumNames = 16 CaptName1 = Erik CaptName2 = Johnny CaptName3 = Chris CaptName4 = k001011 CaptName5 = k110110 CaptName6 = k001011 CaptName7 = k010010 CaptName8 = k000010 CaptName9 = k110111 CaptName10 = k101101 CaptName11 = k101111 CaptName12 = k001011 CaptName13 = k001000 CaptName14 = k101110 CaptName15 = k010111 CaptName16 = k000101 CaptName16 = Manglor |
Update of /cvsroot/timewarp/ships/ppi/shpalabo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15656/ships/ppi/shpalabo Added Files: content.ini doog.jgm panel_01.bmp panel_02.bmp panel_03.bmp panel_04.bmp panel_05.bmp panel_06.bmp panel_07.bmp ship_01.bmp shot_a_01.bmp shot_b_00.bmp shot_b_01.bmp shot_b_02.bmp shot_b_03.bmp shot_b_04.bmp shot_b_05.bmp shot_b_06.bmp shot_b_07.bmp shot_b_08.bmp shot_b_09.bmp shot_e_00.bmp shot_e_01.bmp shot_e_02.bmp shot_e_03.bmp shot_e_04.bmp shot_e_05.bmp shot_e_06.bmp shot_e_07.bmp shot_e_08.bmp shot_e_09.bmp shot_e_10.bmp shot_e_11.bmp shot_e_12.bmp shot_e_13.bmp shot_e_14.bmp shot_e_15.bmp shot_e_16.bmp shot_e_17.bmp shot_e_18.bmp shot_e_19.bmp shot_e_20.bmp shot_e_21.bmp shot_e_22.bmp shot_e_23.bmp shot_e_24.bmp shot_e_25.bmp shot_e_26.bmp shot_e_27.bmp shot_e_28.bmp shot_e_29.bmp shot_e_30.bmp shot_e_31.bmp shot_e_32.bmp shot_e_33.bmp shot_e_34.bmp shot_e_35.bmp shot_e_36.bmp shot_e_37.bmp shot_e_38.bmp shot_e_39.bmp special_01.wav weapon_01.wav weapon_02.wav Log Message: --- NEW FILE: shot_e_23.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_29.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_20.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_24.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_16.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_39.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_35.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_25.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_26.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_07.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_11.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_38.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_18.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: doog.jgm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_27.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_07.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_21.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: weapon_01.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_09.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_a_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: weapon_02.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_13.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_14.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_17.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_34.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_08.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_03.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: content.ini --- [Objects] ShipSprites = ship_ 1 +r WeaponSprites = shot_a_ 1 +r WeaponExplosion = shot_b_ 10 +alpha SpecialSprites = shot_e_ 40 +alpha SpecialExplosion = ExtraSprites = ExtraSamples = ExtraExplosion = PanelBitmaps = panel_ 7 WeaponSamples = weapon_ 2 SpecialSamples = special_ 1 Ditty = doog.jgm --- NEW FILE: shot_e_37.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_12.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_33.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_09.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_22.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_32.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_31.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_05.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_00.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_08.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_30.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_06.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_b_02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_36.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_02.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_15.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_10.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_19.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_00.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_07.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: special_01.wav --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_04.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: panel_01.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shot_e_28.bmp --- (This appears to be a binary file; contents omitted.) |
From: Rob <geo...@us...> - 2006-01-29 16:20:58
|
Update of /cvsroot/timewarp/ships/ppi/shptauhu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14751/shptauhu Log Message: Directory /cvsroot/timewarp/ships/ppi/shptauhu added to the repository |
From: Rob <geo...@us...> - 2006-01-29 16:20:58
|
Update of /cvsroot/timewarp/ships/ppi/shpalabo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14751/shpalabo Log Message: Directory /cvsroot/timewarp/ships/ppi/shpalabo added to the repository |
From: Rob <geo...@us...> - 2006-01-29 16:20:54
|
Update of /cvsroot/timewarp/ships/ppi/shpscain In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14751/shpscain Log Message: Directory /cvsroot/timewarp/ships/ppi/shpscain added to the repository |
From: Rob <geo...@us...> - 2006-01-29 16:20:44
|
Update of /cvsroot/timewarp/ships/ppi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14710/ppi Log Message: Directory /cvsroot/timewarp/ships/ppi added to the repository |
From: Rob <geo...@us...> - 2006-01-29 16:19:30
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14332 Modified Files: twwin.dsp Log Message: Index: twwin.dsp =================================================================== RCS file: /cvsroot/timewarp/twwin.dsp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** twwin.dsp 11 Jul 2005 00:25:01 -0000 1.53 --- twwin.dsp 29 Jan 2006 16:19:22 -0000 1.54 *************** *** 270,273 **** --- 270,281 ---- # Begin Source File + SOURCE=.\source\other\lightning.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\other\lightning.h + # End Source File + # Begin Source File + SOURCE=.\source\other\luaport.cpp # End Source File *************** *** 414,425 **** # Begin Source File - SOURCE=.\source\games\ShipDocGenerator.cpp - # End Source File - # Begin Source File - - SOURCE=.\source\games\ShipDocGenerator.h - # End Source File - # Begin Source File - SOURCE=.\source\games\vanguard.cpp # End Source File --- 422,425 ---- *************** *** 621,624 **** --- 621,628 ---- # Begin Source File + SOURCE=.\source\newships\shpalhha.cpp + # End Source File + # Begin Source File + SOURCE=.\source\newships\shparitr.cpp # End Source File *************** *** 1108,1111 **** --- 1112,1159 ---- # End Source File # End Group + # Begin Group "ppiships" + + # PROP Default_Filter "" + # Begin Source File + + SOURCE=.\source\ppiships\shpalabo.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpchmba.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpfrebo.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpfweav.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpgluse.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpostor.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpsacda.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpscain.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shpstrgu.cpp + # End Source File + # Begin Source File + + SOURCE=.\source\ppiships\shputwde.cpp + # End Source File + # End Group # End Group # Begin Group "twgui" |
From: Rob <geo...@us...> - 2006-01-29 16:18:42
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14038/source/other Added Files: lightning.cpp lightning.h Log Message: --- NEW FILE: lightning.cpp --- #include "lightning.h" Lightning::~Lightning() { destroy_bitmap(lightningbmp); } bool Lightning::visible() const { return (sparktime > 0); } void Lightning::update(double time) { if (sparktime > 0) sparktime -= time; else sparktime = 0; } void Lightning::reset() { sparktime = maxsparktime; } void Lightning::locate(Vector2 newpos) { lightningrelpos = newpos + 0.5 * Vector2(lightningbmp->w,lightningbmp->h); } void Lightning::init(BITMAP *ashpbmp, Vector2 alightningrelpos, int amaxsparktime, int aRmax) { shpbmp = ashpbmp; maxsparktime = amaxsparktime; reset(); Rmax = aRmax; lightningrelpos = alightningrelpos; int bpp = bitmap_color_depth(shpbmp); lightningbmp = create_bitmap_ex(bpp, shpbmp->w, shpbmp->h); clear_to_color(lightningbmp, makeacol(0,0,0,255)); } void Lightning::draw(Frame *space, Vector2 plot_pos, Vector2 plot_size) { STACKTRACE; Vector2 P, S; //return; //clear_to_color(lightningbmp, makeacol(0,0,0,255)); //circlefill(lightningbmp, P.x, P.y, 10, makeacol(255,0,0,200)); // first, let the image grow fainter BITMAP *b; b = lightningbmp; int ix, iy; int iw, ih; iw = b->w; ih = b->h; P = lightningrelpos; // assume it's a 32 bit image ... unsigned char *a; for ( iy = 0; iy < ih; ++iy ) { a = (unsigned char*) b->line[iy]; a += 0; // red = the 3rd color (in my case). for ( ix = 0; ix < iw; ++ix ) { // reduce colors int i; for ( i = 0; i < 3; ++i ) { if (*a > 5) (*a) -= 5; else (*a) = 0; ++a; } ++a; } } if (sparktime > 0) { // create some kind of lightning now ? How ? int i, N; N = 5 + rand() % 5; //graphics double ang, R; ang = (rand() % 360) * PI/180; //graphics for ( i = 0; i < N; ++i ) { double dx, dy; //dx = (random(double(iw)) - 0.5*iw) / N; //dy = (random(double(ih)) - 0.5*ih) / N; ang += (rand() % 180 - 90) * PI/180; //graphics R = (rand() % int(Rmax+1)) / N; //graphics dx = R * cos(ang); dy = R * sin(ang); int j, M; M = 10; for ( j = 0; j < M; ++j ) { P.x += dx / M; P.y += dy / M; int col; int re, gr, bl; col = getpixel(shpbmp, iround(P.x), iround(P.y)); re = getr(col); gr = getg(col); bl = getb(col); if ( !(re == 255 && gr == 0 && bl == 255)) { int k; k = iround(128*(0.5 + 0.5*sparktime/maxsparktime)); // re = 0; // bl = 0; // if ( k > 96) // re = k + 127 / (i+1); // else // bl = k + 127 / (i+1); double c, f; //f = (0.5 + (0.5*sparktime)/maxsparktime); f = sparktime / maxsparktime; c = 255;// / (i+1); re = iround(f * c); bl = iround((1-f) * c); putpixel(b, iround(P.x), iround(P.y), makeacol(re,0,bl,255)); } } } } // target position ix = iround(plot_pos.x); iy = iround(plot_pos.y); // target size iw = iround(plot_size.x); ih = iround(plot_size.y); int aa; aa = aa_get_mode(); aa_set_mode(aa | AA_ALPHA); aa_stretch_blit(lightningbmp, space->surface, 0, 0,lightningbmp->w,lightningbmp->h, ix, iy, iw, ih); aa_set_mode(aa); space->add_box(ix, iy, iw, ih); } --- NEW FILE: lightning.h --- #ifndef __LIGHTNING_ #define __LIGHTNING_ #include "../ship.h" #include "../scp.h" #include "../util/aastr.h" #include "../melee/mview.h" #include "../frame.h" #include <stdlib.h> class Lightning { //void calc_lightning(BITMAP *shpbmp); Vector2 lightningrelpos; double maxsparktime, Rmax; BITMAP *lightningbmp, *shpbmp; //Vector2 sparkpos; int sparktime; public: ~Lightning(); void init(BITMAP *ashpbmp, Vector2 alightningrelpos, int amaxsparktime, int aRmax); void update(double amount); void reset(); void locate(Vector2 newpos); bool visible() const; void draw(Frame *space, Vector2 plot_pos, Vector2 plot_size); }; #endif |
From: Rob <geo...@us...> - 2006-01-29 16:14:44
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/melee Modified Files: mgame.cpp mship.cpp mshot.cpp mshot.h mshpdata.cpp msprite.cpp Log Message: Index: mshpdata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshpdata.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mshpdata.cpp 5 Oct 2005 20:20:57 -0000 1.16 --- mshpdata.cpp 29 Jan 2006 16:14:34 -0000 1.17 *************** *** 21,24 **** --- 21,25 ---- #include "mship.h" #include "mtarget.h" + #include "mview.h" *************** *** 69,142 **** int shipdatas_loaded = 0; ! ShipData *shipdata ( const char *file ) { int i; - if (!file) return NULL; - for ( i = 0; i < num_shipdatas; i += 1 ) { - if (!strcmp(file, shipdatas[i]->file) ) return shipdatas[i]; - } - if (!exists(file)) return NULL; - ShipData *data = new ShipData(file); - num_shipdatas += 1; - shipdatas = (ShipData**)realloc(shipdatas, num_shipdatas * sizeof(ShipData*)); - shipdatas[num_shipdatas-1] = data; - return data; - } - /* - void load_ship_data(shiptype_type *type) { - if(type->dat != NULL) - return; - ships_loaded += 1; - char fn[256]; - sprintf(fn, "ships/shp%s.dat", type->id); - type->dat = new ShipData(fn); - type->dat->type = type; - return; - } ! void unload_ship_data(shiptype_type *type) { ! if(type->dat == NULL) ! return; ! ships_loaded -= 1; ! delete type->dat; ! type->dat = NULL; ! return; ! } ! void load_all_ship_data() { ! int i; ! for (i = 0; i < num_shiptypes; i += 1) { ! load_ship_data(&shiptypes[i]); } - return; - } ! void unload_all_ship_data() { ! int i; ! for (i = 0; i < num_shiptypes; i += 1) { ! unload_ship_data(&shiptypes[i]); ! } ! return; ! } ! void unload_unused_ship_data() { ! int i; ! for (i = 0; i < num_shiptypes; i += 1) { ! if (shiptypes[i].dat && (shiptypes[i].dat->references == 0)) { ! unload_ship_data(&shiptypes[i]); ! } ! } ! return; ! } ! */ ! /* ! static BITMAP *copy_bitmap(BITMAP *old) { ! BITMAP *r; ! r = create_bitmap(old->w, old->h); ! blit (old, r, 0, 0, 0, 0, old->w, old->h); ! return r; } ! */ void save_spacesprite2(SpaceSprite *ss, const char *spritename, const char *destination, const char *extension) { --- 70,100 ---- int shipdatas_loaded = 0; ! ShipData *shipdata ( const char *file ) ! { int i; ! if (!file) ! return NULL; ! for ( i = 0; i < num_shipdatas; i += 1 ) ! { ! // if these data already exist ! if (strcmp(file, shipdatas[i]->file) == 0 ) ! return shipdatas[i]; } ! // well... there's now also the option of a directory, so ... don't perform this check anymore ! //if (!exists(file)) ! // return NULL; ! num_shipdatas += 1; ! shipdatas = (ShipData**)realloc(shipdatas, num_shipdatas * sizeof(ShipData*)); + ShipData *data = new ShipData(file); + shipdatas[num_shipdatas-1] = data; ! return data; } ! void save_spacesprite2(SpaceSprite *ss, const char *spritename, const char *destination, const char *extension) { *************** *** 222,226 **** } ! void ShipData::unlock() { references -= 1; --- 180,185 ---- } ! void ShipData::unlock() ! { references -= 1; *************** *** 299,345 **** } ! // clean up these pointer arrays ... ! // these were created with the "new" command --> use delete ! // also, the wave data are kept in memory... you've to remove those data ! if (data) { ! unload_datafile(data); ! data = 0; ! } else { ! int i; ! if (sampleWeapon) ! { ! for( i = 0; i < num_weapon_samples; ++i ) ! { ! if (sampleWeapon[i]) ! destroy_sample(sampleWeapon[i]); ! } ! } ! ! if (sampleSpecial) { ! for( i = 0; i < num_special_samples; ++i ) ! { ! if (sampleSpecial[i]) ! destroy_sample(sampleSpecial[i]); ! } } ! ! if (sampleExtra) { ! for( i = 0; i < num_extra_samples; ++i ) ! { ! if (sampleExtra[i]) ! destroy_sample(sampleExtra[i]); ! } } ! ! ! if (moduleVictory) { ! destroy_mod(moduleVictory); ! //moduleVictory = 0; } } if (sampleWeapon) --- 258,296 ---- } ! ! int i; ! if (sampleWeapon) { ! for( i = 0; i < num_weapon_samples; ++i ) { ! if (sampleWeapon[i]) ! destroy_sample(sampleWeapon[i]); } ! } ! ! if (sampleSpecial) ! { ! for( i = 0; i < num_special_samples; ++i ) { ! if (sampleSpecial[i]) ! destroy_sample(sampleSpecial[i]); } ! } ! ! if (sampleExtra) ! { ! for( i = 0; i < num_extra_samples; ++i ) { ! if (sampleExtra[i]) ! destroy_sample(sampleExtra[i]); } } + + + if (moduleVictory) + { + destroy_mod(moduleVictory); + //moduleVictory = 0; + } if (sampleWeapon) *************** *** 371,375 **** ShipData::ShipData(const char *filename) : - data(NULL), spriteShip(NULL), spriteWeapon(NULL), --- 322,325 ---- *************** *** 392,396 **** } ! #include "mview.h" SpaceSprite *load_sprite(const char *string, DATAFILE *data, int *index) { --- 342,348 ---- } ! ! ! /** load (copy) a sprite from a data file in memory */ SpaceSprite *load_sprite(const char *string, DATAFILE *data, int *index) { *************** *** 440,460 **** ! for (i = 0; i < count; i += 1) { ! //xxx Geo - I don't think there is much to gain by doing this. ! // and why is it by default an RLE_SPRITE ????? ! // destroy_rle_sprite((RLE_SPRITE*)data[(*index)+i].dat); ! // data[(*index)+i].dat = NULL; ! // brutal hack to free up the memory } - *index += count; return sprite; } void *copy_data(void *data, int N) { --- 392,548 ---- ! *index += count; ! return sprite; ! } ! ! ! ! ! ! /** load a sprite from a set of .bmp files in format *_01.bmp from disk. ! A sample line can read: ShipSprites = ship 1 +r +alpha. ! The first item is the base of the file name, the second is the number of files to read into ! the sprite, and then there are options. */ ! SpaceSprite *load_sprite(const char *ini_string, char *dirname, int default_attrib) ! { ! // first, read the arguments from the .ini string. ! int argc; ! char **argv = get_config_argv("Objects", ini_string, &argc); ! if (!argc) return NULL; ! ! // the first argument is the base of the filename. ! char base_filename[512]; ! strcpy(base_filename, dirname); ! strcat(base_filename, "/"); ! strcat(base_filename, argv[0]); ! ! // the second is the number of files that you should read. ! int count = 0; ! count = atoi(argv[1]); ! if (!count) ! return 0; ! ! // and then, there are some options. ! ! char buffy[512]; buffy[0] = 0; ! char *cp = buffy; ! int rotations = 1; ! ! int i; ! // arg 0 = base name ! // arg 1 = count ! // start checking for options at 2. ! for (i = 2; i < argc; i += 1) ! { ! char *command = argv[i]; ! if (strcmp(command, "+r")==0 || strcmp(command, "+rotate")==0) ! { ! // use default rotations (64) ! rotations = 64; ! ! } else if ((argv[i][0] == '-') || (argv[i][0] == '+')) ! { ! // read spacesprite attributes. ! cp += sprintf(cp, "%s ", argv[i]); ! } else ! { ! tw_error("Unrecognized command %s in %s", argv[i], base_filename); ! } } + // read the bitmaps into memory (in the colordepth of the file) + // these are temporary - they usually require a color-depth conversion anyway. + // allow count start at 0 or at 1... + int count_base = 0; + BITMAP **bmplist = new BITMAP* [count]; + for ( i = 0; i < count; ++i ) + { + char filename[512]; + sprintf(filename, "%s%02i.bmp", base_filename, i+count_base); // combine the filename-base, the _number, and the .bmp extension + bmplist[i] = load_bitmap(filename, 0); + if (!bmplist[i]) + { + if (i == 0) + { + // perhaps you should start counting at 1 instead of 0. + --i; // start checking at 0 again + ++count_base; // but with a higher base count. + if (count_base > 1) + { + tw_error("Count base too high for sprite image %s", filename); + } + } else { + tw_error("Failed to load sprite image file %s", filename); + } + } + } + + int attrib = default_attrib | string_to_sprite_attributes(buffy, 0); + + SpaceSprite *sprite = new SpaceSprite(bmplist, count, attrib, rotations); + + // remove the temporary image data + for ( i = 0; i < count; ++i ) + { + destroy_bitmap(bmplist[i]); + } + delete [] bmplist; + + return sprite; } + + /** load .wav samples */ + void load_sample(char *ini_string, char *dirname, int *num_weapon_samples, Sound*** sampleWeapon) + { + int argc; + char **argv = get_config_argv("Objects", ini_string, &argc); + if (!argc) + return; + + // base name + char base_filename[512]; + strcpy(base_filename, dirname); + strcat(base_filename, "/"); + strcat(base_filename, argv[0]); + + // load weapon samples + int count = atoi(argv[1]); + if (!count) + return; + + Sound **sample; + + + sample = new SAMPLE*[count]; + + int i; + for(i = 0; i < count; i++) + { + char filename[512]; + sprintf(filename, "%s%02i.wav", base_filename, i+1); + + sample[i] = load_sample(filename);//copy_sample( (SAMPLE *)data[index].dat ); + + if (!sample[i]) + { + tw_error("Failed to initialize sample %s", filename); + } + + } + + + *num_weapon_samples = count; + *sampleWeapon = sample; + } + + + void *copy_data(void *data, int N) { *************** *** 567,583 **** } - void ShipData::load() - { - //test_pointers(); int i, index = 0, count; - // if (status != LOADED_NONE) return; - - data = load_datafile(file); - - if(!data) - tw_error("Error loading '%s'", file); - push_config_state(); set_config_data((char *)(data[index].dat), data[index].size); --- 655,663 ---- } + void ShipData::load_datafile(DATAFILE *data) + { int i, index = 0, count; push_config_state(); set_config_data((char *)(data[index].dat), data[index].size); *************** *** 682,686 **** pop_config_state(); unload_datafile(data); - data = 0; // hmmm... in SAMPLE, there's a pointer to "data" --- 762,765 ---- *************** *** 690,765 **** //test_pointers(); - return; - /* if (tw_alert("transform this datafile?", "No", "Yes") != 2) - return; - char dname[512], fname[512], header[8192]; - sprintf(dname, strstr(file, "shp")+3); - dname[strlen(dname)-4] = 0; - sprintf (header, "[Main]\n"); - sprintf (header, "type = Ship\n"); - //panel bitmaps - sprintf (header, "num_panel_bitmaps = %d\n", num_panel_bitmaps); - for (i = 0; i < num_panel_bitmaps; i += 1) { - sprintf(fname, "%s/panel%03d.pcx", dname, i); - save_bitmap(fname, bitmapPanel[i], NULL); - }*/ ! //sound effects ! /* fprintf (f, "num_weapon_samples = %d\n", num_weapon_samples); ! for (i = 0; i < num_weapon_samples; i += 1) { ! sprintf(fname, "%s/WeaponSample%03d.wav", dname, i); ! //save_sample(fname, bitmapPanel[i]); ! } ! fprintf (f, "num_special_samples = %d\n", num_special_samples); ! for (i = 0; i < num_weapon_samples; i += 1) { ! sprintf(fname, "%s/SpecialSample%03d.wav", dname, i); ! //save_sample(fname, bitmapPanel[i]); ! } ! fprintf (f, "num_extra_samples = %d\n", num_extra_samples); ! for (i = 0; i < num_extra_samples; i += 1) { ! sprintf(fname, "%s/ExtraSample%03d.wav", dname, i); ! //save_sample(fname, bitmapPanel[i]); ! } ! fclose(f);*/ ! //SpaceSprites ! /* sprintf(fname, "%s/000index.txt", dname); ! set_config_file(fname); ! // moduleVictory; ! save_spacesprite2(spriteShip, "ShipSprite", dname, ".bmp"); ! // save_spacesprite(spriteWeapon, "WeaponSprite", dname, ".bmp"); ! // save_spacesprite(spriteWeaponExplosion, "WeaponExplosionSprite", dname, ".bmp"); ! // save_spacesprite(spriteSpecial, "SpecialSprite", dname, ".bmp"); ! // save_spacesprite(spriteSpecialExplosion, "SpecialExplosionSprite", dname, ".bmp"); ! // save_spacesprite(spriteExtra, "ExtraSprite", dname, ".bmp"); ! // save_spacesprite(spriteExtraExplosion, "ExtraExplosionSprite", dname, ".bmp"); ! return;*/ } ! ShipData::~ShipData() { ! unload(); ! /* if(spriteShip) ! delete spriteShip; ! if(spriteWeapon) ! delete spriteWeapon; ! if(spriteWeaponExplosion) ! delete spriteWeaponExplosion; ! if(spriteSpecial) ! delete spriteSpecial; ! if(spriteSpecialExplosion) ! delete spriteSpecialExplosion; ! if(spriteExtra) ! delete spriteExtra; ! if (spritePanel) ! delete spritePanel; ! unload_datafile(data);*/ free(file); --- 769,886 ---- //test_pointers(); + } ! void ShipData::load_directory(char *dirname) ! { ! // load the ship configuration data. ! char info_filename[512]; ! strcpy(info_filename, dirname); ! strcat(info_filename, "/content.ini"); ! push_config_state(); ! set_config_file(info_filename); ! ! int basic_attrib = SpaceSprite::MASKED | SpaceSprite::MATCH_SCREEN_FORMAT; ! // and mipmapped? nah. ! ! // load the ship panel sprites. This sprite are irregular by default, because the bitmaps have different sizes. ! spritePanel = load_sprite("PanelBitmaps", dirname, basic_attrib | SpaceSprite::IRREGULAR); ! ! // load ship sprites ! spriteShip = load_sprite("ShipSprites", dirname, basic_attrib); ! ! // load weapon sprites ! spriteWeapon = load_sprite("WeaponSprites", dirname, basic_attrib); ! ! // load weapon explosion sprites ! spriteWeaponExplosion = load_sprite("WeaponExplosion", dirname, basic_attrib); ! ! // load special ability sprites ! spriteSpecial = load_sprite("SpecialSprites", dirname, basic_attrib); ! ! // load special ability explosion sprites ! spriteSpecialExplosion = load_sprite("SpecialExplosion", dirname, basic_attrib); ! ! // load extra sprites ! spriteExtra = load_sprite("ExtraSprites", dirname, basic_attrib); ! ! // load extra explosion sprites ! spriteExtraExplosion = load_sprite("ExtraExplosion", dirname, basic_attrib); ! ! //load optional super-extra sprites ! int i = 0; ! more_sprites = NULL; ! for (;;) ! { ! char buffy[512]; ! sprintf(buffy, "ExtraExtraSprites%d", i); ! ! if (get_config_int("Objects", buffy, -1) == -1) ! break; ! ! more_sprites = (SpaceSprite**) realloc(more_sprites, (i+1) * sizeof(SpaceSprite*)); ! more_sprites[i] = load_sprite(buffy, dirname, 0); ! i += 1; ! } ! num_more_sprites = i; ! ! ! ! // initialize ship victory ditty ! char modfilename[512]; ! strcpy(modfilename, get_config_string("Objects", "Ditty", "")); ! moduleVictory = load_mod(modfilename); ! ! load_sample("WeaponSamples", dirname, &num_weapon_samples, &sampleWeapon); ! ! load_sample("SpecialSamples", dirname, &num_special_samples, &sampleSpecial); ! ! load_sample("ExtraSamples", dirname, &num_extra_samples, &sampleExtra); ! ! ! shipdatas_loaded += 1; ! status = LOADED_FULL; ! ! // all data is copied, so now, you can discard the original data file ! ! pop_config_state(); ! } ! ! ! ! ! void ShipData::load() { ! //test_pointers(); ! DATAFILE *data; ! data = ::load_datafile(file); ! if(data) ! { ! load_datafile(data); ! //tw_error("Error loading '%s'", file); ! } else { ! char tmp[512]; ! strcpy(tmp, file); ! char *dot = strrchr(tmp, '.'); //Find last occurrence of character in string ! *dot = 0; // now, the dot becomes the end of the string. ! ! load_directory(tmp); // without the .dat extension. ! } ! ! } ! ! ! ! ShipData::~ShipData() ! { ! unload(); free(file); Index: msprite.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/msprite.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** msprite.cpp 5 Oct 2005 20:23:00 -0000 1.29 --- msprite.cpp 29 Jan 2006 16:14:34 -0000 1.30 *************** *** 1286,1287 **** --- 1286,1382 ---- return sbitmap[miplevel][index]; } + + + + + + + // all the sprite-relevant information (and nothing else). + SpaceSprite::SpaceSprite(BITMAP **bmplist, int sprite_count, int _attributes, int rotations) + { + count_base = sprite_count; // real different images + count_rotations = rotations; // derived rotations from each image. + count = sprite_count * rotations; + if ((rotations < 1) || (count < 1)) {tw_error("SpaceSprite::SpaceSprite - bad parameters");} + + int i, j, obpp; + + if (_attributes == -1) _attributes = string_to_sprite_attributes(NULL); + + references = 0; + highest_mip = 0; + for (i = 1; i < MAX_MIP_LEVELS; i += 1) { + sbitmap[i] = NULL; + } + + general_attributes = _attributes; + if (general_attributes & MATCH_SCREEN_FORMAT) { + bpp = videosystem.bpp; + if (general_attributes & ALPHA) { + if (bpp <= 16) bpp = 16; + else bpp = 32; + bpp = 32; + } + } + else bpp = 0; + + obpp = bitmap_color_depth(bmplist[0]); + + if (bpp == 0) bpp = obpp; + if (general_attributes & ALPHA) { + if (bpp <= 16) bpp = 16; + else bpp = 32; + } + + + smask = new PMASK*[count]; + sbitmap[0] = new BITMAP* [count]; + attributes = new char [count]; + + for ( i = 0; i < sprite_count; ++i ) + { + + BITMAP *bmp = NULL; + bmp = create_bitmap_ex(bpp, bmplist[i]->w, bmplist[i]->h); + + if (general_attributes & MASKED) + clear_to_color(bmp, bitmap_mask_color(bmp)); + + if (obpp != bpp) + { + convert_bitmap(bmplist[i], bmp, (general_attributes & MASKED) ? AA_MASKED : 0); + + } else { + + if (general_attributes & MASKED) + draw_sprite(bmp, bmplist[i], 0, 0); + else + blit(bmplist[i], bmp, 0, 0, 0, 0, bmp->w, bmp->h); + } + + //color_correct_bitmap(bmp, general_attributes & MASKED); + + + for (j = 1; j < rotations; j += 1) + { + + int index = j + (i * rotations); + smask[index] = 0; + + sbitmap[0][index] = 0;//tmp; + attributes[j + (i * rotations)] = DEALLOCATE_IMAGE | DEALLOCATE_MASK; + } + + int index = i * rotations; + smask[index] = 0; + + sbitmap[0][index] = bmp; + attributes[index] = DEALLOCATE_IMAGE | DEALLOCATE_MASK; + + } + + if (general_attributes & MIPMAPED) { + generate_mipmaps(); + } + } + Index: mshot.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshot.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mshot.cpp 5 Oct 2005 20:24:49 -0000 1.22 --- mshot.cpp 29 Jan 2006 16:14:34 -0000 1.23 *************** *** 370,371 **** --- 370,461 ---- return; } + + + + + + + + + TimedShot::TimedShot(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, + double ovel, double otime, double oarmour, double odamage) + : + SpaceObject(creator, 0, 0, osprite), + armour(oarmour), + existtime(0), + maxtime(otime) + { + angle = creator->angle + orelangle; + pos = creator->pos + rotate(orelpos, creator->angle - PI/2); + vel = ovel * unit_vector(angle); + + layer = LAYER_SHOTS; + + collide_flag_anyone = ALL_LAYERS; + collide_flag_sameteam = ALL_LAYERS; + collide_flag_sameship = 0; + + damage_factor = odamage; + + isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; + } + + void TimedShot::calculate() + { + STACKTRACE + SpaceObject::calculate(); + + if (!(ship && ship->exists())) + { + state = 0; + return; + } + + if (existtime >= maxtime) + { + state = 0; + return; + } + + existtime += frame_time * 1E-3; + + // always orient the shot in the direction of movement. + angle = vel.angle(); + sprite_index = get_index(angle); + } + + void TimedShot::inflict_damage(SpaceObject *other) + { + STACKTRACE + // copied from Shot::infli... + + if (!other->exists()) return; + + damage(other, damage_factor); + + //if (!other->isShot()) state = 0; + if (other->isblockingweapons) state = 0; + + if (state == 0) + { + //animateExplosion(); + //soundExplosion(); + } + + } + + int TimedShot::handle_damage(SpaceLocation *source, double normal, double direct) + { + STACKTRACE + armour -= (normal + direct); + + if (armour <= 0) + { + armour = 0; + state = 0; + } + + return true; + } + Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** mship.cpp 5 Oct 2005 20:23:55 -0000 1.45 --- mship.cpp 29 Jan 2006 16:14:34 -0000 1.46 *************** *** 181,190 **** shiptypes[i].name = strdup(name); shiptypes[i].cost = get_config_int("Info", "TWCost", 0); const char *data = get_config_string("Info", "Data", NULL); if (!data) { replace_extension(buffy, file, "dat", 2040); shiptypes[i].data = shipdata(buffy); } ! else shiptypes[i].data = shipdata(data); const char *text = get_config_string("Info", "Description", NULL); if (!text) { --- 181,194 ---- shiptypes[i].name = strdup(name); shiptypes[i].cost = get_config_int("Info", "TWCost", 0); + const char *data = get_config_string("Info", "Data", NULL); + if (!data) { replace_extension(buffy, file, "dat", 2040); shiptypes[i].data = shipdata(buffy); } ! else ! shiptypes[i].data = shipdata(data); ! const char *text = get_config_string("Info", "Description", NULL); if (!text) { *************** *** 235,240 **** void _register_shiptype_dir ( const char *fn, int attrib, int param ) { char buffy[2048]; ! if (!(attrib & FA_DIREC)) return; ! if (strstr(fn, ".")) return; if (param > 0) { sprintf(buffy, "%s/*", fn); --- 239,255 ---- void _register_shiptype_dir ( const char *fn, int attrib, int param ) { char buffy[2048]; ! ! // you can only recurse into a directory ! if (!(attrib & FA_DIREC)) ! return; ! ! // do not go to directories containing a . ! if (strstr(fn, ".")) ! return; ! ! // do not go to subdirectories that start with shp, because those are reserved for ship-data ! if (strncmp(fn, "shp", 3) == 0) ! return; ! if (param > 0) { sprintf(buffy, "%s/*", fn); *************** *** 248,308 **** _register_shiptype_dir ( "ships", FA_DIREC|FA_RDONLY|FA_ARCH, 3 ); - /* shiptype_type tmp; - int i = _num_shiptypes; - int num_bad = 0; - - num_shiptypes = i; - while (i > 0) { - int bad = false; - i -= 1; - - //check ini file exists - char ini_name[80]; - char dat_name[80]; - sprintf(fname, "ships/shp%s.ini", shiptypes[i].id); - if (!exists(ini_name)) bad = true; - - sprintf(dat_name, "ships/shp%s.dat", shiptypes[i].id); - if (!exists(dat_name)) bad = true; - - set_config_file(ini_name); - const char *tmp = get_config_string("Info", "Data", NULL); - if (!tmp) tmp = ini_name; - if (!exists(tmp)) bad = true; - shiptypes[i].cost = get_config_int("Info", "TWCost", 999); - shiptypes[i].name = get_config_string("Info", "Name", NULL); - if (!shiptypes[i].name) { - char sname[1024]; - const char *tmp; - int l = 0; - tmp = get_config_string("Info", "Name0", NULL); - if (tmp) { - l += sprintf(sname + l, "%s ", tmp); - } - tmp = get_config_string("Info", "Name1", NULL); - if (!tmp) - tw_error("init_ships - error initializing name (%s)", shiptypes[i].id); - l += sprintf(sname + l, "%s", tmp); - int n = 1; - while (true) { - char buf[25]; - n += 1; - sprintf(buf, "Name%d", n); - tmp = get_config_string("Info", buf, NULL); - if (!tmp) break; - l += sprintf(sname + l, " %s", tmp); - } - shiptypes[i].name = strdup(sname); - } - else shiptypes[i].name = strdup(shiptypes[i].name); - } - tmp = shiptypes[i]; - shiptypes[i] = shiptypes[num_shiptypes-1]; - memmove(&shiptypes[i], &shiptypes[num_shiptypes-1], sizeof(shiptype_type)); - num_shiptypes -= 1; - - if (num_shiptypes == 0) - tw_error("No ship data available.\nProbably caused to an install problem.\nConsult readme.txt"); - */ return; } --- 263,266 ---- Index: mshot.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshot.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mshot.h 23 Aug 2005 22:21:16 -0000 1.7 --- mshot.h 29 Jan 2006 16:14:34 -0000 1.8 *************** *** 6,9 **** --- 6,10 ---- #include "mgame.h" + /** shot - uses one image, independent of angle */ class Shot : public SpaceObject { IDENTITY(Shot); *************** *** 41,44 **** --- 42,46 ---- }; + /** animated shot - flies straight ahead, and cycles through images in the spacesprite */ class AnimatedShot : public Shot { IDENTITY(AnimatedShot); *************** *** 56,59 **** --- 58,62 ---- }; + /** missile - flies straight ahead */ class Missile : public Shot { IDENTITY(Missile); *************** *** 67,70 **** --- 70,74 ---- }; + /** homing missile - flies to target. Uses indexed image from the spacesprite */ class HomingMissile : public Missile { IDENTITY(HomingMissile); *************** *** 82,85 **** --- 86,90 ---- }; + /** a laser */ class Laser : public SpaceLine { IDENTITY(Laser); *************** *** 100,103 **** --- 105,109 ---- }; + /** laser that goes from source point to target point */ class PointLaser : public Laser { *************** *** 116,118 **** --- 122,143 ---- + /** A shot that expires after a specified time */ + class TimedShot : public SpaceObject + { + public: + IDENTITY(TimedShot); + public: + double armour; + double existtime, maxtime; + + TimedShot(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, + double ovel, double otime, double oarmour, double odamage); + + virtual void calculate(); + + virtual void inflict_damage(SpaceObject *other); + virtual int handle_damage(SpaceLocation *source, double normal, double direct); + }; + + #endif // __MSHOT_H__ Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** mgame.cpp 5 Oct 2005 20:24:49 -0000 1.59 --- mgame.cpp 29 Jan 2006 16:14:33 -0000 1.60 *************** *** 1364,1375 **** lag_decrease = 0; - // tracker about home many extra physics iterations are inserted; this shouldn't get too high - int num_catchups = 0; - const int max_catchups = 3; - int time_start = get_time(); iteration_histogram_init(time_start); // if you increase lag, iterations can be skipped... --- 1364,1375 ---- lag_decrease = 0; int time_start = get_time(); iteration_histogram_init(time_start); + int check_game_time = get_time(); + + static av_frame_time = 0; + // if you increase lag, iterations can be skipped... *************** *** 1379,1384 **** while(!game_done) { - unsigned int time; --- 1379,1385 ---- while(!game_done) { + // int av_frame_time_t1, av_frame_time_t2; + // av_frame_time_t1 = get_time(); *************** *** 1390,1404 **** - // physics can catch up with graphics. - bool catching_up; - catching_up = false; - - // check if something interesting happens in this iteration (false), otherwise (true) - // issue an idle time. - bool idle_iteration = true; - - time = get_time(); - // this is used to time animation and physics - #ifdef _DEBUG --- 1391,1394 ---- *************** *** 1417,1704 **** #endif - // note, you go to the next calculation either because some required time has - // passed, or because you need to catch up with some kind of lag... ! if (time >= next_tic_time)//geo:physics should be independent of animation && (next_render_time > game_time)) && ! /*(game_ready() || game_time == 0)*/ { // note that game_time==0 is also needed, cause otherwise it'll wait for data, while no data've been generated yet. ! _STACKTRACE("Game::play - Game physics"); ! // wait till you receive signal that you can proceed to the next iteration. ! // ALL COMMUNICATION EXCEPT FOR DESYNCH TEST SHOULD GO THROUGH HERE. ! // also see the CALL and EVENT macros ! ! if (events.all_ready()) ! { ! // only reset the call-state, if previously, all calls have been handled. ! events.set_wait(); ! } ! ! int t = get_time(); ! ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) { ! l->flush_noblock(); ! ! l->recv_noblock(); // receive stuff, if you can ! } - events.handle(); // this will read events. You send events during the game. - // if all "start-iterations" are set, then they're all_ready. ! // Note, that the IF statement ensures, that you do not block the game by waiting ! // for (networked) input. This means, that graphics won't be blocked: otherwise, ! // graphics of this user can be delayed by graphics of another user, resulting in ! // a pretty slow framerate. - if (events.all_ready()) - { - idle_iteration = false; - - - iteration_histogram(time); //ok, another iteration; update the histogram! ! // check if a player was asked to be removed here.. ! int i; ! for ( i = 0; i < num_network; ++i ) ! { ! if (!player[i]) ! continue; ! ! if (!player[i]->status) ! { ! if ( i == p_local) ! { ! // send remaining data before disconnecting. ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) ! { ! l->flush_block(); ! } ! } ! ! player[i]->control->keys = 0; // leave with clean default keys. ! remove_player(i); ! // this will set player[i]=0 ! } ! } ! ! // test if there was an event that causes the game to quit. ! if (game_done) ! { ! iteration_histogram_writelog(); ! return; ! } ! // } ! // note that, to reduce lag, you keep reading data from the buffer without ! // adding extra stuff (through CALL), so that it becomes smaller. ! // BUT: that skips keys, and this leads to a desynch SO THIS IS NOT A GOOD WAY TO DO IT !! ! ! ! int t_execute = get_time(); - // calculate game stuff - // this increases game_time. - calculate(); - // this measures how much time it takes to execute one physics iteration - t_execute = get_time() - t_execute; - - - - // check if the network is in synch? - - // enable this if you want to check for desynches - // but, it only makes sense (in current implementation), if the two games are synched. - if (global_lag_synch && do_desynch_test) - { - // send desynch data for local player(s) - int p; - for ( p = 0 ; p < num_network; ++p ) - { - if (player[p] && player[p]->islocal()) - { - CALL(event_share_desynch, p); - } - } - - // check desynch data of the players in the current (lagged) frame. - check_desynch(); - } - - // it's best to do this only in debug mode... - - // handle some important buttons... - // must be done before the keys are re-set to 0 by the share_key - if (player[p_local] && !skip_iteration ) - { - if ( (player[p_local]->control->keys & keyflag::inc_lag) != 0) - { ! if (toggle_key_inc_lag) ! { ! CALL(event_lag_increase, p_local); ! toggle_key_inc_lag = false; ! } ! } else { ! toggle_key_inc_lag = true; ! } ! ! if ( (player[p_local]->control->keys & keyflag::dec_lag) != 0) { ! ! if (toggle_key_dec_lag && lag_buffer > 1) ! { ! CALL(event_lag_decrease, p_local); ! toggle_key_dec_lag = false; ! } ! } else { ! toggle_key_dec_lag = true; } } ! // this can also do some game stuff ... (namely, Esc = quit) ! while (keypressed()) ! handle_key(readkey()); ! ! // actually ... duh ... it's best to call this AFTER the events-handle, cause then the data ! // have some time to be sent across the network, while the game is doing its calculations. ! // namely, then it's using the idle() time that's required or so... ! ! ! network_share_keys(); ! ! // after it's used, it can be re-set. ! skip_iteration = false; ! ! // crc checking is now only available, if all the games involved run synchronized, ! // this is also a (much simpler) desynch test. ! if (global_lag_synch) ! network_crc_check(); ! ! ! // approve of the next iteration, after ALL possible event thingies are done. ! if (lag_decrease == 0) { ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) ! { ! CALL(start_iteration, p); ! } ! } ! } else { ! --lag_decrease; // skip new-iteration calls. ! --lag_buffer; } ! // and increasing lag means, adding extra, empty, iterations... ! int ilag; ! for ( ilag = 0; ilag < lag_increase; ++ilag ) { ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) ! { ! // notify within this iteration ! // that this iteration is "empty", i.e., no control-info and such ! CALL(notify_skip_iteration, p); ! ! CALL(start_iteration, p); ! ! } ! } ! ++lag_buffer; ! --lag_increase; } ! ! if (auto_unload) ! unload_unused_ship_data(); ! ! ! //if (key[KEY_F4]) ! // turbo = f4_turbo; ! //else ! // turbo = normal_turbo; ! ! // ------------ GAME TIME MANAGEMENT ------------ ! ! // this hiccup-margin allows physics to "catch up" a few iterations that are ! // skipped by graphics. ! int time_current = get_time(); ! ! ! ! double factor = 0.25; ! int frame_time_length = frame_time / turbo; ! if (t_execute < factor*frame_time_length) { ! // in this case, you can try to have physics in a linear fashion ! ! if ((hiccup_margin >= 0) ! && (num_catchups < max_catchups) // prevent too many catchups (that will delay graphics update too much) ! && (next_tic_time + hiccup_margin > time_current + frame_time_length)) ! { ! ! ! if (next_tic_time + frame_time_length < time_current) ! { ! catching_up = true; ! next_tic_time += frame_time_length; ! // perhaps this is better... cause you're below "time" anyway... ! // so you will be catching up anyway... in the loop that follows ! // An immediate catchup will happen, because next_tic_time < time, which ! // is the only constraint to enter this physics calculation immediately ! // again, thus "accelerating" the physics updates, thus making up for ! // time lost in animation or during network delays. ! ! } else { ! catching_up = false; ! ! // trying to execute frames in a linear fashion. ! next_tic_time += frame_time_length; // but if there are >1 catchups, then hurry up!! ! } ! ! } else { ! catching_up = false; ! next_tic_time = time_current + frame_time_length; // execute as often as possible. ! } ! } else { ! // otherwise, the game calculations take so long, that trying to catch up ! // is nigh impossible. ! catching_up = false; ! next_tic_time += frame_time_length; ! ! if (next_tic_time < time_current) ! next_tic_time = time_current + frame_time_length; // execute as often as possible. } ! ! if (catching_up) ! ++num_catchups; ! else ! num_catchups = 0; ! ! ! if (next_fps_time <= game_time) { ! next_fps_time += msecs_per_fps; ! fps(); ! } ! ! } ! ! } ! --- 1407,1646 ---- #endif ! // timing is as follows: [idle] [physics] [rendering] = total frame_time milliseconds. + // the [idle] part + int ttest = get_time(); ! if (check_game_time <= ttest) // if you're lagging ! { ! // you've exceeded the frame boundary... try to set a new one ! // using the desired period. ! check_game_time = ttest + frame_time; // increase by a minimal amount. ! } else { ! // stay idle for the part that isn't used in this frame ! while (get_time() < check_game_time) { ! idle(1); } ! // set the time of the next frame boundary ! check_game_time += frame_time; ! } ! // the [physics] part ! // wait till you receive signal that you can proceed to the next iteration. ! // ALL COMMUNICATION EXCEPT FOR DESYNCH TEST SHOULD GO THROUGH HERE. ! // also see the CALL and EVENT macros ! ! if (events.all_ready()) ! { ! // only reset the call-state, if previously, all calls have been handled. ! events.set_wait(); ! } ! ! ! int t = get_time(); ! ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) ! { ! l->flush_noblock(); ! ! l->recv_noblock(); // receive stuff, if you can ! ! } ! events.handle(); // this will read events. You send events during the game. ! // if all "start-iterations" are set, then they're all_ready. ! ! // Note, that the IF statement ensures, that you do not block the game by waiting ! // for (networked) input. This means, that graphics won't be blocked: otherwise, ! // graphics of this user can be delayed by graphics of another user, resulting in ! // a pretty slow framerate. ! ! // wait till all events are ready... ! int count_idle = 0; ! while (!events.all_ready()) ! { ! idle(1); ! ! ++count_idle; ! if (count_idle > 1000) ! { ! tw_error("Too much lag."); ! } ! } ! ! ! iteration_histogram(get_time()); //ok, another iteration; update the histogram! ! ! // check if a player was asked to be removed here.. ! int i; ! for ( i = 0; i < num_network; ++i ) ! { ! if (!player[i]) ! continue; ! ! if (!player[i]->status) ! { ! if ( i == p_local) ! { ! // send remaining data before disconnecting. ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) { ! l->flush_block(); } } ! player[i]->control->keys = 0; // leave with clean default keys. ! remove_player(i); ! // this will set player[i]=0 ! } ! } ! ! // test if there was an event that causes the game to quit. ! if (game_done) ! { ! iteration_histogram_writelog(); ! return; ! } ! // } ! // note that, to reduce lag, you keep reading data from the buffer without ! // adding extra stuff (through CALL), so that it becomes smaller. ! // BUT: that skips keys, and this leads to a desynch SO THIS IS NOT A GOOD WAY TO DO IT !! ! ! ! int t_execute = get_time(); ! ! // calculate game stuff ! // this increases game_time. ! calculate(); ! ! // this measures how much time it takes to execute one physics iteration ! t_execute = get_time() - t_execute; ! ! ! ! // check if the network is in synch? ! ! // enable this if you want to check for desynches ! // but, it only makes sense (in current implementation), if the two games are synched. ! if (global_lag_synch && do_desynch_test) ! { ! // send desynch data for local player(s) ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) { ! CALL(event_share_desynch, p); } + } + + // check desynch data of the players in the current (lagged) frame. + check_desynch(); + } + + // it's best to do this only in debug mode... + + + // handle some important buttons... + // must be done before the keys are re-set to 0 by the share_key + if (player[p_local] && !skip_iteration ) + { + + if ( (player[p_local]->control->keys & keyflag::inc_lag) != 0) + { ! if (toggle_key_inc_lag) { ! CALL(event_lag_increase, p_local); ! toggle_key_inc_lag = false; } ! } else { ! toggle_key_inc_lag = true; ! } + if ( (player[p_local]->control->keys & keyflag::dec_lag) != 0) + { ! if (toggle_key_dec_lag && lag_buffer > 1) { ! CALL(event_lag_decrease, p_local); ! toggle_key_dec_lag = false; } ! } else { ! toggle_key_dec_lag = true; ! } ! } ! ! // this can also do some game stuff ... (namely, Esc = quit) ! while (keypressed()) ! handle_key(readkey()); ! ! // actually ... duh ... it's best to call this AFTER the events-handle, cause then the data ! // have some time to be sent across the network, while the game is doing its calculations. ! // namely, then it's using the idle() time that's required or so... ! ! ! network_share_keys(); ! ! // after it's used, it can be re-set. ! skip_iteration = false; ! ! // crc checking is now only available, if all the games involved run synchronized, ! // this is also a (much simpler) desynch test. ! if (global_lag_synch) ! network_crc_check(); ! ! ! // approve of the next iteration, after ALL possible event thingies are done. ! if (lag_decrease == 0) ! { ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) { ! CALL(start_iteration, p); ! } } ! } else { ! --lag_decrease; // skip new-iteration calls. ! --lag_buffer; } ! ! // and increasing lag means, adding extra, empty, iterations... ! int ilag; ! for ( ilag = 0; ilag < lag_increase; ++ilag ) ! { ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) ! { ! // notify within this iteration ! // that this iteration is "empty", i.e., no control-info and such ! CALL(notify_skip_iteration, p); ! ! CALL(start_iteration, p); ! ! } ! } ! ++lag_buffer; ! --lag_increase; ! } ! ! if (auto_unload) ! unload_unused_ship_data(); *************** *** 1717,1766 **** l->flush_noblock(); // this sends, if there's something to send at least } - - - - // geo: instead of game_time, I use time, so that physics and animation are competely - // independent; then, if physics has to wait for networked data, animation can continue - // regardless of that. - // well... except if physics tries to catch up a few frames of time. But in that case, - // in networked games, it can take a while to synch back again; - // so there must be an upper limit to the animation frame rate !! - time = get_time(); - if (!catching_up || time >= next_render_time - msecs_per_render + msecs_per_render_max) - { - if (/*interpolate_frames ||*/ (time >= next_render_time)) - { - _STACKTRACE("Game::play - Game rendering") - - idle_iteration = false; - - animate(); - - #ifdef _DEBUG - //idle(debug_idle_time_animate); - #endif - - next_render_time += msecs_per_render; - - time = get_time(); - // actually, just don't bother about linear timing animations... because there is - // a rather bad effect on game lag if too much time is allocated for animation. - next_render_time = time + msecs_per_render; - } - } ! if (idle_iteration) ! { ! // if nothing interesting happened in this iteration, then insert some idle time ! int n = 1; ! idle(n); ! tot_idle_time += n; ! } ! } --- 1659,1676 ---- l->flush_noblock(); // this sends, if there's something to send at least } ! // the [animate] part ! ! animate(); ! ! // some statistics. ! // av_frame_time_t2 = get_time(); ! // av_frame_time = 0.8 * av_frame_time + 0.1 * (av_frame_time_t2 - av_frame_time_t1); ! // message.print(100, 15, "desired frametime = %3i actual frame-time = %3i ms", frame_time, av_frame_time); } |
From: Rob <geo...@us...> - 2006-01-29 16:14:43
|
Update of /cvsroot/timewarp/source/ppiships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/ppiships Added Files: shpalabo.cpp shpchmba.cpp shpfrebo.cpp shpfweav.cpp shpgluse.cpp shpostor.cpp shpsacda.cpp shpscain.cpp shpstrgu.cpp shputwde.cpp Log Message: --- NEW FILE: shputwde.cpp --- /* $Id: shputwde.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" REGISTER_FILE //#include "../sc1ships.h" /* Copy of the Velron Cruiser And Phedar Patrol Ship */ class UtwigDefender : public Ship { public: IDENTITY(UtwigDefender); protected: double shipSpecialDrain; double weaponRangeMin, weaponRangeMax; double weaponVelocityMin, weaponVelocityMax; double weaponRelativity; int weaponDamageMin, weaponDamageMax; int weaponArmourMin, weaponArmourMax; double weaponRecoil, weaponRecoilMaxSpeed; double minBattForThrust; bool inverseLights; double specialVelocity; int specialFrames; double energizetimer, energizetimemax; int energizepersonalarmour; public: UtwigDefender(Vector2 opos, double angle, ShipData *data, unsigned int code); protected: virtual int activate_weapon(); virtual int activate_special(); // virtual void calculate_turn_left(); // virtual void calculate_turn_right(); // virtual void calculate_thrust(); virtual void calculate_hotspots(); virtual void calculate(); virtual RGB crewPanelColor(int k = 0); virtual int handle_damage(SpaceLocation *src, double normal, double direct=0); }; class UtwigDefenderBolt : public Shot { public: IDENTITY(UtwigDefenderBolt); int maxDamage, maxArmour, referenceDamage; double relative_damage; public: UtwigDefenderBolt(SpaceLocation *creator, double ox, double oy, double oangle, double ov, int odamage, int rdamage, double orange, int oarmour, SpaceSprite *osprite, double relativity); virtual void calculate(); virtual int handle_damage(SpaceLocation* source, double normal, double direct); virtual void animateExplosion(); }; class UtwigDefenderCrewPodPP : public SpaceObject { public: IDENTITY(UtwigDefenderCrewPodPP); public: int frame_count; int frame_size; int frame_step; // double velocity; int life; int lifetime; double v; UtwigDefenderCrewPodPP(Vector2 opos, int oLifeTime, Ship *oship, SpaceSprite *osprite, int ofcount, int ofsize, double ov); virtual void calculate(); virtual int sameTeam(SpaceLocation *other); virtual void inflict_damage(SpaceObject *other); virtual int handle_damage(SpaceLocation *source, double normal, double direct = 0); }; UtwigDefender::UtwigDefender(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { minBattForThrust = (get_config_float("Ship", "MinBattForThrust", 8)); shipSpecialDrain = get_config_int("Ship", "SpecialDrain",1); weaponRangeMin = scale_range(get_config_float("Weapon", "RangeMin", 10)); weaponRangeMax = scale_range(get_config_float("Weapon", "RangeMax", 60)); weaponVelocityMin = scale_velocity(get_config_float("Weapon", "VelocityMin", 65)); weaponVelocityMax = scale_velocity(get_config_float("Weapon", "VelocityMax", 95)); weaponRelativity = get_config_float("Weapon", "Relativity", 0.0); weaponRecoil = scale_velocity(get_config_float("Weapon", "Recoil", 20)); weaponRecoilMaxSpeed = scale_velocity(get_config_float("Weapon", "RecoilMaxSpeed", 40)); if (weaponRecoilMaxSpeed <= 0) weaponRecoilMaxSpeed = MAX_SPEED; weaponDamageMin = get_config_int("Weapon", "DamageMin", 4); weaponDamageMax = get_config_int("Weapon", "DamageMax", 18); weaponArmourMin = get_config_int("Weapon", "ArmourMin", 2); weaponArmourMax = get_config_int("Weapon", "ArmourMax", 10); inverseLights = (get_config_int("Ship", "InverseLights", 1) != 0); energizepersonalarmour = 0; specialVelocity = scale_velocity(get_config_float("Special", "Velocity", 0)); specialFrames = get_config_int("Special", "Frames", 0); energizetimemax = get_config_float("Special", "Timer", 0) * 1000.0; energizetimer = 0; } int UtwigDefender::activate_weapon() { STACKTRACE double tmpR = (batt-weapon_drain)/(double)batt_max; //get power level batt = weapon_drain; double wv = weaponVelocityMin + (weaponVelocityMax - weaponVelocityMin) * tmpR; //velocity int wd = weaponDamageMin + (int)ceil( (weaponDamageMax - weaponDamageMin) * tmpR ); //damage game->add(new UtwigDefenderBolt(this, 0, 46+16, angle, wv, wd, weaponDamageMax, weaponRangeMin + (int)ceil( (weaponRangeMax - weaponRangeMin) * tmpR ), weaponArmourMin + (int)ceil( (weaponArmourMax - weaponArmourMin) * tmpR ), data->spriteWeapon, weaponRelativity)); accelerate (this, angle + PI, weaponRecoil * wv * wd / (weaponDamageMax * weaponVelocityMax), weaponRecoilMaxSpeed); //accelerate_gravwhip (this, angle + PI, weaponRecoil * wv * wd / (weaponDamageMax * weaponVelocityMax), weaponRecoilMaxSpeed); //finally, the recoil is roughly proportional to the power level squared (mass ~ damge, and physical recoil ~ mass*velocity) return(TRUE); } RGB UtwigDefender::crewPanelColor(int k) { STACKTRACE // change the crew color, if needed if ( energizepersonalarmour ) { RGB c = {255,200,200}; return c; } else { return Ship::crewPanelColor(k); } } int UtwigDefender::activate_special() { energizepersonalarmour = TRUE; energizetimer = energizetimemax; update_panel = 1; // update the panel! return(TRUE); } /* void UtwigDefender::calculate_turn_left() { STACKTRACE if(turn_left) { if (batt >= minBattForThrust) turn_step -= (turn_rate) * frame_time; else { double tmp = 1.0 - (batt / (double)minBattForThrust); turn_step -= (1.0 - tmp * tmp) * turn_rate * frame_time; } } } void UtwigDefender::calculate_turn_right() { STACKTRACE if(turn_right) { if (batt >= minBattForThrust) turn_step += (turn_rate) * frame_time; else { double tmp = 1.0 - (batt/(double)minBattForThrust); turn_step += (1.0 - tmp * tmp) * turn_rate * frame_time; } } } void UtwigDefender::calculate_thrust() { STACKTRACE if (batt >= minBattForThrust) Ship::calculate_thrust(); } */ void UtwigDefender::calculate_hotspots() { STACKTRACE if (batt >= minBattForThrust) Ship::calculate_hotspots(); } void UtwigDefender::calculate() { STACKTRACE Ship::calculate(); if(batt < minBattForThrust) { if (inverseLights) sprite_index += 64; } else { if (!inverseLights) sprite_index += 64; } //set InverseLights to 0 if you want lights ON whent the engine is ON //set InverseLights to 1 if you want lights ON whent the engine is OFF if ( energizepersonalarmour ) { if ( energizetimer > 0 ) { energizetimer -= frame_time; } else { energizetimer = 0; energizepersonalarmour = 0; update_panel = 1; } } } int UtwigDefender::handle_damage(SpaceLocation *src, double normal, double direct) { STACKTRACE; double totdam = normal + direct; // you also have to deal with negative damage, i.e., crew increase - that's // especially important for this ship !! if ( totdam < 0 ) { crew -= totdam; if ( crew > crew_max ) crew = crew_max; return iround(totdam); } if ( energizepersonalarmour ) { double evac = 0; while ( evac < totdam && crew >= 1 ) // yeah, the last one may also leave !! { // otherwise, it's hard to die ;) Vector2 D = -unit_vector(vel) * this->size.x; D += tw_random(Vector2(50,50)) - Vector2(25,25); UtwigDefenderCrewPodPP *cp = new UtwigDefenderCrewPodPP( this->normal_pos() + D, specialFrames, this, data->spriteSpecial, 32, specialFrames, specialVelocity); cp->vel = 0.5 * vel; cp->target = this; add(cp); -- crew; ++evac; } } else { Ship::handle_damage(src, normal, direct); } // don't use == 0, but use < 1, cause of possible partial damage ? I assume, 0.8 crew is also dead crew... if ( crew < 1 ) { crew = 0; Ship::handle_damage(src, 0, 0); // use the "default" die procedure } return iround(totdam); } UtwigDefenderBolt::UtwigDefenderBolt(SpaceLocation *creator, double ox, double oy, double oangle, double ov, int odamage, int rdamage, double orange, int oarmour, SpaceSprite *osprite, double relativity) : Shot(creator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, creator, osprite, relativity), maxDamage(odamage), maxArmour(oarmour), referenceDamage(rdamage) { explosionSprite = data->spriteWeaponExplosion; explosionFrameCount = 40; explosionFrameSize = 12; relative_damage = 0; sprite_index = (int)floor( 40 * (referenceDamage - maxDamage) / (double)referenceDamage ); attributes &= ~ATTRIB_STANDARD_INDEX; } void UtwigDefenderBolt::calculate() { STACKTRACE Shot::calculate(); if (!exists()) return; //to avoid (d > r) //helpers double tmpR, tmp; tmpR = (range - d) / range; //calculating current damage tmp = maxDamage * tmpR; damage_factor = (int)(tmp); damage_factor += (int)( (tmp - damage_factor) * 2 ); //current sprite_index is proportinal to the damage_factor sprite_index = (int)floor( 40 * (referenceDamage - tmp) / referenceDamage ); //calculating current range tmp = maxArmour * tmpR; armour = (int)(tmp); armour += (int)( (tmp - armour) * 2 ); if (armour < 1) armour = 1; //just in case } int UtwigDefenderBolt::handle_damage(SpaceLocation* source, double normal, double direct) { STACKTRACE if (normal+direct > 0) { relative_damage += (normal + direct) / (double)armour; if (relative_damage >= 1) return Shot::handle_damage(this, 9999, 9999); else return iround(normal + direct); } return 0; } void UtwigDefenderBolt::animateExplosion() { STACKTRACE if (damage_factor <= 0) return; // just in case int start_frame = (int)(sprite_index / 1.7); int frame_count = explosionFrameCount - start_frame; game->add(new Animation(this, pos, explosionSprite, start_frame, frame_count, (int)(500.0/frame_count), DEPTH_EXPLOSIONS)); return; } UtwigDefenderCrewPodPP::UtwigDefenderCrewPodPP(Vector2 opos, int oLifeTime, Ship *oship, SpaceSprite *osprite, int ofcount, int ofsize, double ov) : SpaceObject(oship, opos, 0.0, osprite), frame_count(ofcount), frame_size(ofsize), frame_step(0), life(0), lifetime(oLifeTime), v(ov) { collide_flag_sameship = ALL_LAYERS; collide_flag_sameteam = ALL_LAYERS; layer = LAYER_SPECIAL; set_depth(DEPTH_SPECIAL); isblockingweapons = false; debug_id = 2; // for debugging purpose attributes &= ~ATTRIB_STANDARD_INDEX; } int UtwigDefenderCrewPodPP::sameTeam(SpaceLocation *other) { STACKTRACE return true; } void UtwigDefenderCrewPodPP::calculate() { STACKTRACE; frame_step += frame_time; while (frame_step >= frame_size) { frame_step -= frame_size; sprite_index++; if(sprite_index == frame_count) sprite_index = 0; } life += frame_time; if(life >= lifetime) { state = 0; return; } double a = trajectory_angle(target); vel = v * unit_vector(a); SpaceObject::calculate(); if (!target) die(); } void UtwigDefenderCrewPodPP::inflict_damage(SpaceObject *other) { STACKTRACE; if (other->isShip() && other->damage_factor == 0) { // sound.stop(data->sampleExtra[0]); // sound.play(data->sampleExtra[0]); damage(other, 0, -1); state = 0; } } int UtwigDefenderCrewPodPP::handle_damage(SpaceLocation *source, double normal, double direct) { STACKTRACE; state = 0; // this is extra; eg. if hit by a asteroid or so. return 0; } REGISTER_SHIP (UtwigDefender) --- NEW FILE: shpscain.cpp --- /* $Id: shpscain.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" #include "../scp.h" REGISTER_FILE #include "../other/lightning.h" /** Copy of the Korvian Sniper Lightning taken from Narool Lurker */ void draw_lightning(Vector2 lightningrelpos, int sparktime, int maxsparktime, int Rmax, BITMAP *lightningbmp, BITMAP *shpbmp, Frame *space, Vector2 plot_pos, Vector2 plot_size); class ScavengerInterloper : public Ship { public: IDENTITY(ScavengerInterloper); public: double weaponRange; double weaponVelocity; int weaponDamage; int weaponArmour; double specialRange, specialVelocity; int specialDamage, specialArmour, SkipperPeriod, VisiblePeriod; double SkipperMaxAngle; int cloak; int cloak_frame; Lightning lightning; public: static int cloak_color[3]; ScavengerInterloper(Vector2 opos, double angle, ShipData *data, unsigned int code); virtual double isInvisible() const; virtual int activate_weapon(); virtual int activate_special(); virtual void calculate_hotspots(); virtual void calculate(); virtual void animate(Frame *space); // add code to activate the sparks virtual void inflict_damage(SpaceObject *other); }; class ScavengerInterloperMissile : public Missile { public: IDENTITY(ScavengerInterloperMissile); public: ScavengerInterloperMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite); }; class SkipperMissile : public Missile { IDENTITY(SkipperMissile); int timer, vtime; int visible_period, skipper_period; double max_angle_change; public: SkipperMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite, int askipper_period, int avisible_period, double max_angle_change); virtual void calculate(); virtual double isInvisible() const; virtual void animate(Frame *space); public: }; ScavengerInterloper::ScavengerInterloper(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); weaponDamage = get_config_int("Weapon", "Damage", 0); weaponArmour = get_config_int("Weapon", "Armour", 0); specialRange = scale_range( get_config_float("Special", "Range", 50) ); specialVelocity = scale_velocity( get_config_float("Special", "Velocity", 30) ); specialDamage = get_config_int("Special", "Damage", 1); specialArmour = get_config_int("Special", "Armour", 2); SkipperPeriod = get_config_int("Special", "SkipperPeriod", 1000); VisiblePeriod = get_config_int("Special", "VisiblePeriod", 500); SkipperMaxAngle = get_config_float("Special", "MaxAngle", 45.0) * PI / 180.0; cloak = TRUE; debug_id = 1009; BITMAP *shpbmp = sprite->get_bitmap(0); double maxsparktime = get_config_float("Quirk", "maxsparktime", 2000); double Rmax = get_config_float("Quirk", "Rmax", 1); lightning.init(shpbmp, 0, maxsparktime, Rmax); } double ScavengerInterloper::isInvisible() const { if (lightning.visible()) return 0; else return 1; } int ScavengerInterloper::activate_weapon() { game->add(new ScavengerInterloperMissile( Vector2(0.0, size.y / 2.0), angle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, this, data->spriteWeapon)); play_sound2(data->sampleWeapon[0]); return TRUE; } int ScavengerInterloper::activate_special() { game->add(new SkipperMissile( Vector2(0.0, size.y / 2.0), angle, specialVelocity, specialDamage, specialRange, specialArmour, this, data->spriteSpecial, SkipperPeriod, VisiblePeriod, SkipperMaxAngle)); return TRUE; } void ScavengerInterloper::calculate_hotspots() { //Ship::calculate_hotspots(); } void ScavengerInterloper::calculate() { lightning.update(frame_time); Ship::calculate(); } void ScavengerInterloper::animate(Frame *space) { if (!show_red_cloaker || (control && is_bot(control->channel)) || (control && !is_local(control->channel)) || (!game_networked && num_network>1)) // bots and remote players are "hidden" { #ifdef _DEBUG sprite->animate_character( pos, sprite_index, pallete_color[4], space); #else sprite->animate_character( pos, sprite_index, pallete_color[255], space); #endif } else { sprite->animate_character( pos, sprite_index, pallete_color[4], space); } return; } void ScavengerInterloper::inflict_damage(SpaceObject *other) { Ship::inflict_damage(other); //you've hit something; (re)activate sparks. lightning.reset(); // but, where did you hit it ? // place the source somewhere... at the edge .. how ? double a, R; a = trajectory_angle(other); R = 20; lightning.locate(R * unit_vector(a)); } ScavengerInterloperMissile::ScavengerInterloperMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite) : Missile(oship, opos, oangle, ov, odamage, orange, oarmour, oship ,osprite) { explosionSprite = data->spriteWeaponExplosion; explosionFrameCount = explosionSprite->frames(); explosionFrameSize = 50; debug_id = 1011; } SkipperMissile::SkipperMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite, int askipper_period, int avisible_period, double amax_angle_change) : Missile(oship, opos, oangle, ov, odamage, orange, oarmour, oship ,osprite) { timer = 0; vtime = 0; visible_period = avisible_period; skipper_period = askipper_period; max_angle_change = amax_angle_change; } void SkipperMissile::calculate() { timer += frame_time; if (vtime > 0) vtime -= frame_time; else vtime = 0; if (timer > skipper_period) { timer -= skipper_period; // re-orientate, and become visible for a short while vtime = visible_period; // desired change in angle. double a = trajectory_angle(target); double da = a - angle; while (da < -PI) da += PI2; while (da > PI) da -= PI2; // change the angle by a maximum amount if (da < -max_angle_change) da = -max_angle_change; if (da > max_angle_change) da = max_angle_change; angle += da; vel = v * unit_vector(angle); } Missile::calculate(); if (!target) die(); } double SkipperMissile::isInvisible() const { if (vtime > 0) return 0; else return 1; } void SkipperMissile::animate(Frame *space) { if (!isInvisible()) Missile::animate(space); } REGISTER_SHIP(ScavengerInterloper) --- NEW FILE: shpstrgu.cpp --- /* $Id: shpstrgu.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" REGISTER_FILE #include <string.h> #include "../melee/mview.h" /** Copy of the Estion Gunner */ // platform relaying blink length [cyhawk] #define STRIVANAR_PLATFORM_BLINK 100 class StrivanarPlatform; class StrivanarGunner : public Ship { public: IDENTITY(StrivanarGunner); double weaponRange; double weaponVelocity; int weaponDamage; int weaponArmour; // max shot bump correction angle [cyhawk] double weaponAngle; // weapon cycle variable [cyhawk] int weaponGraphics; int specialArmour; int specialFrameSize; public: StrivanarGunner(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); int num_platforms; int max_platforms; StrivanarPlatform **platform; virtual int activate_weapon(); virtual int activate_special(); }; class StrivanarShot : public Shot { public: IDENTITY(StrivanarShot); double relayAngle; public: StrivanarGunner *mother_ship; StrivanarShot(Vector2 opos, double angle, double velocity, int damage, double range, int armour, StrivanarGunner *ship, int osprite_index, double oRelayAngle); SpaceLocation *last_shooter; virtual void inflict_damage(SpaceObject *other) ; }; class StrivanarPlatform : public SpaceObject { public: IDENTITY(StrivanarPlatform); double health; int rotate_time; int rotate_direction; SpaceSprite* explosionSprite; int explosionFrameCount; int explosionFrameSize; SAMPLE* explosionSample; public: // blink support [cyhawk] int blink; StrivanarPlatform (StrivanarGunner *ship, int health, int oFrameSize); virtual int handle_damage (SpaceLocation *source, double normal, double direct) ; virtual void ship_died(); virtual void calculate(); virtual void death(); }; int StrivanarPlatform::handle_damage (SpaceLocation *source, double normal, double direct) { STACKTRACE; health -= normal + direct; if (health < 0){ state = 0; // display explosion graphics [cyhawk] game->add(new Animation(this, normal_pos(), explosionSprite, 0, explosionFrameCount, explosionFrameSize, LAYER_EXPLOSIONS)); // play explosion sound [cyhawk] play_sound( explosionSample ); } return iround(normal + 2 * direct); } void StrivanarPlatform::ship_died() { STACKTRACE // display explosion graphics [cyhawk] game->add(new Animation(this, normal_pos(), explosionSprite, 0, explosionFrameCount, explosionFrameSize, LAYER_EXPLOSIONS)); state = 0; } void StrivanarPlatform::calculate() { STACKTRACE SpaceObject::calculate(); rotate_time -= frame_time; while (rotate_time < 0) { rotate_time += 50; // 64 frames for rotation [cyhawk] sprite_index = (sprite_index + rotate_direction) & 63; } // blink support [cyhawk] if (blink > 0) { sprite = data->spriteExtra; blink -= frame_time; } else sprite = data->spriteSpecial; vel *= exp(-0.0005*frame_time); /* if (magnitude(vel) < 0.05) vel = 0;*/ return; } void StrivanarPlatform::death() { STACKTRACE if (!(ship && ship->exists())) return; //ship is already dead; don't remove platform from list if (ship->data != data) return; //ship is somehow not an Strivanar; perhaps we've been stolen for (int i = 0; i < ((StrivanarGunner*)ship)->num_platforms; i += 1) { if (((StrivanarGunner*)ship)->platform[i] == this) { ((StrivanarGunner*)ship)->platform[i] = NULL; ((StrivanarGunner*)ship)->num_platforms -= 1; memmove(&((StrivanarGunner*)ship)->platform[i], &((StrivanarGunner*)ship)->platform[i+1], (((StrivanarGunner*)ship)->num_platforms-i) * sizeof(StrivanarPlatform*)); return; } } return; } StrivanarPlatform::StrivanarPlatform (StrivanarGunner *ship, int health, int oFrameSize) : SpaceObject(ship, ship->normal_pos(), ship->get_angle(), ship->data->spriteSpecial) { layer = LAYER_SPECIAL; mass = 3; collide_flag_sameship = bit(LAYER_SHOTS) | bit(LAYER_SPECIAL); this->health = health; this->ship = ship; vel = ship->get_vel() + 0.3 * unit_vector(angle); rotate_time = 0; // custom explosion graphics added [cyhawk] explosionSprite = data->spriteSpecialExplosion; explosionFrameCount = data->spriteSpecialExplosion->frames(); explosionFrameSize = oFrameSize; //explosionSample = data->sampleSpecial[1]; commented out by orz ; seems to be a bug? explosionSample = (SAMPLE *)(melee[MELEE_BOOM + BOOM_SAMPLES - 1].dat); // blinking support initialization [cyhawk] blink = 0; if (tw_random() & 1) rotate_direction = 1; else rotate_direction = -1; isblockingweapons = false; attributes &= ~ATTRIB_STANDARD_INDEX; } StrivanarGunner::StrivanarGunner(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { // modified check [cyhawk] if (!data->spriteSpecial || (data->spriteSpecial->frames() != 64)) error("you have the wrong\n version of shpestgu.dat"); weaponDamage = get_config_int("Weapon", "Damage", 0); weaponArmour = get_config_int("Weapon", "Armour", 0); weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); // max shot bump correction angle [cyhawk] weaponAngle = get_config_float("Weapon", "Angle", 0); // weapon cycle initialization [cyhawk] weaponGraphics = 0; specialArmour = get_config_int( "Special", "Armour", 0); specialFrameSize = (int)(time_ratio/get_config_float( "Special", "ExplosionSpeed", 1)); max_platforms = get_config_int( "Special", "Number", 0); num_platforms = 0; platform = new StrivanarPlatform*[max_platforms]; for (int i = 0; i < max_platforms; i += 1) { platform[i] = NULL; } } StrivanarShot::StrivanarShot(Vector2 opos, double angle, double velocity, int damage, double range, int armour, StrivanarGunner *ship, int osprite_index, double oRelayAngle) : Shot(ship, opos, angle, velocity, damage, range, armour, ship, ship->data->spriteWeapon, 0) { collide_flag_sameship = bit(LAYER_SPECIAL); last_shooter = ship; mother_ship = ship; // custom explosion graphics added [cyhawk] explosionSprite = data->spriteWeaponExplosion; explosionFrameCount = data->spriteWeaponExplosion->frames(); explosionFrameSize = time_ratio; // store bump correction angle relayAngle = oRelayAngle; sprite_index = osprite_index; } void StrivanarShot::inflict_damage(SpaceObject *other) { STACKTRACE; if (other == last_shooter) return; if (!sameShip(other) || other == mother_ship) { // don't explode on contact, just damage [cyhawk] Shot::inflict_damage(other); /*Removed on request of MRT - makes the ship too powerful as a camper SpaceObject::inflict_damage(other); // and get bumped back last_shooter = other; double v = magnitude_sqr(vel); double alpha = normalize (atan(vel) , PI2); double min_dist = 999999; int k = -1; for (int i = 0; i < mother_ship->num_platforms; i += 1) { double delta = trajectory_angle (mother_ship->platform[i]); if (normalize (fabs(delta - alpha), PI2) < relayAngle) { double r = distance(mother_ship->platform[i]); if (r < min_dist || k == -1) { min_dist = r; k = i; } } } if (k == -1) { double delta = trajectory_angle (other); vel = v * unit_vector( PI + 2 * delta - alpha ); } else { double delta = trajectory_angle (mother_ship->platform[k]); vel = v * unit_vector(delta); } */ return; } if (!target || target->isInvisible()) return; last_shooter = other; d = 0.0; SpaceLocation *tmp = ship->target; if (!tmp) return; // we're being relayed -- play sound [cyhawk] play_sound( data->sampleExtra[random(data->num_extra_samples)] ); double mr = distance(ship->target); for (int i = 0; i < mother_ship->num_platforms; i += 1) { double r = mother_ship->platform[i]->distance(ship->target); if ((mother_ship->platform[i] != other) && (r < mr) && (distance(mother_ship->platform[i]) < range)) { tmp = mother_ship->platform[i]; mr = r; } // added blink effect [cyhawk] else if (mother_ship->platform[i] == other) { mother_ship->platform[i]->blink = STRIVANAR_PLATFORM_BLINK; } } double rr; Vector2 tt = min_delta(pos, tmp->normal_pos()); rr = magnitude(tt) / v; tt -= tmp->get_vel() * rr; changeDirection( PI+atan(tt)); return; } int StrivanarGunner::activate_weapon() { STACKTRACE // cycle weapon graphics [cyhawk] weaponGraphics++; if (weaponGraphics == data->spriteWeapon->frames()) { weaponGraphics = -data->spriteWeapon->frames() + 2; } Shot *shot = new StrivanarShot(Vector2(0.0, (size.y / 4.0)), angle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, this, abs(weaponGraphics), weaponAngle); game->add(shot); // random firing sound [cyhawk] weapon_sample = random(data->num_weapon_samples); return(TRUE); } int StrivanarGunner::activate_special() { STACKTRACE if (num_platforms == max_platforms) { num_platforms -= 1; platform[0]->state = 0; memcpy(&platform[0], &platform[1], sizeof(StrivanarPlatform*) * num_platforms); platform[num_platforms] = NULL; } StrivanarPlatform *tmp = new StrivanarPlatform(this, specialArmour, specialFrameSize); platform[num_platforms] = tmp; num_platforms += 1; game->add( tmp ); return(TRUE); } REGISTER_SHIP(StrivanarGunner) --- NEW FILE: shpalabo.cpp --- /* $Id: shpalabo.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include <assert.h> #include "../ship.h" #include "../melee/mview.h" #include "../frame.h" REGISTER_FILE /* Copy of the Tau Bomber */ class AlaryBomber : public Ship { public: IDENTITY(AlaryBomber); int bombLifetime; double bombDamageMin, bombDamageMax, bombArmour; double bombProximity, bombBlastRange, bombKick; double special_speedmax, special_accelrate; bool can_launch_bomb; public: AlaryBomber (Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); virtual void calculate(); virtual void calculate_hotspots(); }; class AlaryBomberBomb : public Missile { public: IDENTITY(AlaryBomberBomb); double blast_range, proximity_range, old_range, kick; //int rotation_index; double blast_damage_max, blast_damage_min, lifetime; //double rotation_angle; SpaceObject *tgt; bool active; public: AlaryBomberBomb (SpaceLocation *creator, double ox, double oy, double oangle, double odamage_min, double odamage_max, double oarmour, SpaceSprite *osprite, double oblast_range, double oproximity, int olifetime, double okick); virtual void calculate(); virtual void animate(Frame *space); virtual void animateExplosion(); }; class AlaryBomberBombExplosion : public Presence { public: IDENTITY(AlaryBomberBombExplosion); Vector2 *xp, *xv; int num, lifetime, life_counter, color; public: AlaryBomberBombExplosion(Vector2 opos, double ov, int onum, int olife, int ocolor); virtual void calculate(); virtual void animate(Frame *space); virtual ~AlaryBomberBombExplosion(); }; AlaryBomber::AlaryBomber(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { bombLifetime = int(get_config_float("Bomb", "Lifetime", 0) * 1000); bombDamageMin = get_config_float("Bomb", "DamageMin", 1); bombDamageMax = get_config_float("Bomb", "DamageMax", 3); bombArmour = get_config_float("Bomb", "Armour", 0); bombProximity = scale_range(get_config_float("Bomb", "Proximity", 0)); bombBlastRange = scale_range(get_config_float("Bomb", "BlastRange", 0)); bombKick = scale_velocity(get_config_float("Bomb", "Kick", 0)); special_speedmax = scale_velocity(get_config_float("Afterburn", "SpeedMax", 10.0)); special_accelrate = scale_acceleration(get_config_float("Afterburn", "AccelRate", 10.0)); can_launch_bomb = true; } int AlaryBomber::activate_weapon() { STACKTRACE if (!can_launch_bomb) return false; add(new AlaryBomberBomb(this, 0, 0, angle, bombDamageMin, bombDamageMax, bombArmour, data->spriteWeapon, bombBlastRange, bombProximity, bombLifetime, bombKick)); can_launch_bomb = false; return true; } int AlaryBomber::activate_special() { STACKTRACE; // just some kind of afterburn accelerate(this, angle, special_accelrate * frame_time, special_speedmax); return true; } void AlaryBomber::calculate_hotspots() { Ship::calculate_hotspots(); if (this->fire_special) { Vector2 D = -17*unit_vector(angle+0.5*PI); game->add(new Animation(this, pos + D, meleedata.hotspotSprite, 0, HOTSPOT_FRAMES, time_ratio, DEPTH_HOTSPOTS)); game->add(new Animation(this, pos - D, meleedata.hotspotSprite, 0, HOTSPOT_FRAMES, time_ratio, DEPTH_HOTSPOTS)); } return; } void AlaryBomber::calculate() { STACKTRACE; if (!fire_weapon) can_launch_bomb = true; Ship::calculate(); } AlaryBomberBomb::AlaryBomberBomb (SpaceLocation *creator, double ox, double oy, double oangle, double odamage_min, double odamage_max, double oarmour, SpaceSprite *osprite, double oblast_range, double oproximity, int olifetime, double okick) : Missile(creator, Vector2(ox, oy), oangle, 0, odamage_max, 1e40, oarmour, creator, osprite, 1.0), blast_range(oblast_range), proximity_range(oproximity), old_range(1e40), kick(okick), blast_damage_min(odamage_min), blast_damage_max(odamage_max), lifetime(olifetime), tgt(NULL), active(false) { id = SPACE_OBJECT; collide_flag_sameteam = 0; mass = 0.01; // rotation_angle = 0; // attributes &= ~ATTRIB_SHOT; attributes &= ~ATTRIB_STANDARD_INDEX; } void AlaryBomberBomb::calculate() { STACKTRACE; SpaceLocation::calculate(); // to clean up pointers if (ship && !active) { if ((!ship->exists()) || (!ship->fire_weapon)) { ship = NULL; active = true; } } double d_a = normalize(atan(vel) - angle, PI2); if (d_a > PI) d_a -= PI2; d_a *= 1 - exp(-0.004*magnitude(vel)*frame_time); angle = normalize(angle + d_a, PI2); sprite_index = iround(angle / (PI2/64)) + 16; sprite_index &= 63; // disappear if the target is gone if (!(target && target->exists())) { die(); return; } // explode at the end of its life if (lifetime > 0) lifetime -= frame_time; else damage(this, 999); // the original Tau Bomber checked it neighbourhood in order to detonate the bomb, however, it's far more // efficient to scan only the target. double r0; r0 = distance(target); if (active) { if ( r0 > old_range || target->isInvisible() ) { // however, do not detonate if you're still too close to your own ship ... if (distance(ship) > blast_range) { damage(this, 9999); } } } old_range = r0; } void AlaryBomberBomb::animate(Frame *space) { STACKTRACE sprite->animate(pos, sprite_index,space); } void AlaryBomberBomb::animateExplosion() { STACKTRACE; if (active) { explosionSample = data->sampleWeapon[1]; explosionSprite = data->spriteWeaponExplosion; explosionFrameCount = 10; explosionFrameSize = 50; Query q; double r; int d; // apply damage to anything that is close enough. for (q.begin(this, OBJECT_LAYERS, blast_range, QUERY_OBJECT); q.currento; q.next()) { double dist; dist = distance(q.currento); if (dist > blast_range) continue; r = (blast_range - dist) / blast_range; // distance=0, then r=1 // distance=max, then r=0 // the damage... d = int( blast_damage_min + r * (blast_damage_max - blast_damage_min) ); damage(q.currento, d); if ((q.currento->mass > 0) && (!q.currento->isPlanet())) q.currento->accelerate(this, trajectory_angle(q.currento), kick * r / ((q.currento->mass > 1)?sqrt(q.currento->mass):1), MAX_SPEED); } add(new AlaryBomberBombExplosion(pos, scale_velocity(70), 150, 450, makecol(255,240,140))); } Missile::animateExplosion(); } AlaryBomberBombExplosion::AlaryBomberBombExplosion(Vector2 opos, double ov, int onum, int olife, int ocolor) : Presence(), num(onum), lifetime(olife), life_counter(0), color(ocolor) { if (onum <= 0) { state = 0; return; } set_depth(DEPTH_EXPLOSIONS); xp = new Vector2[num]; xv = new Vector2[num]; int i; for (i=0; i<num; i++) { xp[i] = opos; xv[i] = ov * (0.5+sqrt(sqrt((tw_random(1.0))))) * unit_vector(tw_random(PI2)); } } void AlaryBomberBombExplosion::calculate() { STACKTRACE life_counter += frame_time; if (life_counter >= lifetime) { state = 0; return; } int i; for (i=0; i<num; i++) xp[i] += xv[i] * frame_time; } void AlaryBomberBombExplosion::animate(Frame *space) { STACKTRACE if (state == 0) return; int i, j; double t = 1 - life_counter/(double)lifetime; double x0, y0, dx, dy; int xi, yi; Vector2 p0; drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); for (i=0; i<num; i++) { p0 = corner(xp[i]); x0 = p0.x; y0 = p0.y; p0 = unit_vector(xv[i]) * 3 * space_zoom; dx = p0.x; dy = p0.y; for (j=3; j>=0; j--) { if (space_zoom <= 1) set_trans_blender(0, 0, 0, iround(space_zoom * 255 * t * (4-j) / 4.0)); else set_trans_blender(0, 0, 0, iround(1* 255 * t * (4-j) / 4.0)); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); putpixel(space->surface, xi, yi, color); space->add_pixel(xi, yi); } } drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); } AlaryBomberBombExplosion::~AlaryBomberBombExplosion() { if (num > 0) { delete xp; delete xv; } } REGISTER_SHIP(AlaryBomber) --- NEW FILE: shpchmba.cpp --- /* $Id: shpchmba.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" REGISTER_FILE #define jnk_marker_id 0x2071 class ChmmrBattleshipCrystal; class ChmmrBattleship : public Ship { public: IDENTITY(ChmmrBattleship); friend class ChmmrBattleshipCrystal; double weaponRange; double weaponVelocity; int weaponDamage; int weaponArmour; double specialRange; int specialDamage; double specialAngle; int specialFrames; double extraVisibility; double extraInvisibility; double extraRangeFactor; bool extraShipsOnly; double specialAim; double specialSpread; ChmmrBattleshipCrystal* crystal[8]; public: ChmmrBattleship (Vector2 opos, double angle, ShipData *data, unsigned int code); virtual int activate_weapon(); virtual void calculate_fire_special(); virtual int handle_damage(SpaceLocation *source, double normal, double direct); virtual void materialize(); virtual void calculate(); }; class ChmmrBattleshipCrystal : public SpaceLocation { public: IDENTITY(ChmmrBattleshipCrystal); ChmmrBattleship *ship; double rx, ry, ra; int recharge; public: ChmmrBattleshipCrystal (ChmmrBattleship *oship, double ox, double oy, double ora); virtual void calculate(); }; class ChmmrBattleshipMarker : public SpaceLocation { public: IDENTITY(ChmmrBattleshipMarker); public: SpaceObject *o; ChmmrBattleshipMarker (SpaceLocation *creator, SpaceObject *oo); virtual void calculate(); }; class ChmmrBattleshipMissile : public Missile { public: IDENTITY(ChmmrBattleshipMissile); public: ChmmrBattleshipMissile(SpaceLocation *creator, double ox, double oy, double oangle, double ov, int odamage, double orange, int oarmour, SpaceSprite *osprite); virtual void inflict_damage (SpaceObject *other); }; class ChmmrBattleshipLaser : public Laser { public: IDENTITY(ChmmrBattleshipLaser); int power_left; double base_length; double aim, max_angle, lng, d_a; SpaceObject *tgt; public: ChmmrBattleshipLaser (SpaceLocation *creator, double langle, double mangle, int lcolor, double lrange, int ldamage, int lfcount, SpaceLocation *opos, SpaceObject *otgt, double oaim, double spread); virtual void calculate(); virtual void inflict_damage(SpaceObject *other); }; ChmmrBattleship::ChmmrBattleship(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); weaponDamage = get_config_int("Weapon", "Damage", 0); weaponArmour = get_config_int("Weapon", "Armour", 0); specialDamage = get_config_int("Special", "Damage", 0); specialRange = scale_range(get_config_float("Special", "Range", 0)); specialAngle = get_config_float("Special", "Angle", 90) * ANGLE_RATIO; specialFrames = get_config_int("Special", "Frames", 100); specialAim = get_config_float("Special", "Aim", 0) * ANGLE_RATIO / 1000.0; specialSpread = get_config_float("Special", "Spread", 0) * ANGLE_RATIO; extraVisibility = get_config_float("Extra", "VisibilityPoints", 0); extraInvisibility = get_config_float("Extra", "InvisibilityFactor", 0); extraRangeFactor = get_config_float("Extra", "RangeFactor", 0); extraShipsOnly = !(get_config_int("Extra", "ShipsOnly", 0) == 0); special_low = false; } int ChmmrBattleship::activate_weapon() { STACKTRACE; add(new ChmmrBattleshipMissile(this, -6.0, 45.0, angle , weaponVelocity, weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); add(new ChmmrBattleshipMissile(this, +6.0, 45.0, angle , weaponVelocity, weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); return(TRUE); } void ChmmrBattleship::calculate_fire_special() { STACKTRACE; if ((!fire_special) || (batt >= special_drain)) special_low = false; } void ChmmrBattleship::materialize() { STACKTRACE; Ship::materialize(); for (int i = 0; i <4; i++) { crystal[i]=new ChmmrBattleshipCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2); add(crystal[i]); crystal[i+4]=new ChmmrBattleshipCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2); add(crystal[i+4]); // game->addItem(new ChmmrBattleshipCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2)); // game->addItem(new ChmmrBattleshipCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2)); } } ChmmrBattleshipCrystal::ChmmrBattleshipCrystal (ChmmrBattleship *oship, double ox, double oy, double ora) : SpaceLocation(oship, 0, 0), ship(oship), rx(ox), ry(oy), ra(ora) { collide_flag_anyone = 0; collide_flag_sameteam = 0; collide_flag_sameship = 0; recharge = 1; calculate(); } void ChmmrBattleshipCrystal::calculate() { STACKTRACE; if (state == 0) return; //shouldn't happen SpaceLocation::calculate(); if (!(ship && ship->exists())) { ship = 0; state = 0; return; } angle = normalize(ship->angle + ra, PI2); double alpha = ship->angle ; double tx = cos(alpha); double ty = sin(alpha); pos.x = normalize(ship->pos.x + ry * tx - rx * ty, map_size.x); pos.y = normalize(ship->pos.y + ry * ty + rx * tx, map_size.y); if (recharge > 0) recharge -= frame_time; else if (ship->fire_special) { if (ship->batt < ship->special_drain) { ship->special_low = true; return; }; Query q; SpaceObject *t = NULL; double r1, r = 0; double marks; for (q.begin(this, OBJECT_LAYERS, ship->specialRange, QUERY_OBJECT); q.currento; q.next()) if ((!q.currento->sameTeam(this)) && (q.currento->collide_flag_anyone & bit(LAYER_LINES)) && (!q.currento->isPlanet())) { if (ship->extraShipsOnly && q.currento->isShip()) continue; alpha = trajectory_angle(q.currento); double d_a = normalize(alpha - angle, PI2); if (d_a > PI) d_a -= PI2; if (fabs(d_a) > ship->specialAngle) continue; marks = 0; Query qm; for (qm.begin(q.currento, bit(LAYER_SPECIAL), 10); qm.current; qm.next()) if (qm.current->getID() == jnk_marker_id) if (((ChmmrBattleshipMarker*)qm.current)->o == q.currento) marks += 1; if (!q.currento->isInvisible()) marks += ship->extraVisibility; else marks *= ship->extraInvisibility; r1 = distance(q.currento); if (r1 >= 10.0) marks *= (1 + ship->extraRangeFactor * 10.0 / r1); if (marks > r) { r = marks; t = q.currento; } } if (t) { int c = tw_random(80); c = makecol(160+c, 120+c, 175+c); // game->addItem(new PointLaser(c, ship->specialDamage, ship->specialRange, ship->specialFrames, this, t, 0, 0)); add(new ChmmrBattleshipLaser (this, trajectory_angle(t), ship->specialAngle, c, ship->specialRange, ship->specialDamage, ship->specialFrames, this, t, ship->specialAim * r, ship->specialSpread)); //play_sound(ship->data->sampleSpecial[0]); play_sound(data->sampleSpecial[0]); recharge += ship->special_rate; ship->batt -= ship->special_drain; } } } int ChmmrBattleship::handle_damage (SpaceLocation *source, double normal, double direct) { STACKTRACE; int d = Ship::handle_damage(source, normal, direct); if (state == 0) for (int i =0; i < 8; i++) crystal[i]->state = 0; return d; } void ChmmrBattleship::calculate() { STACKTRACE; Ship::calculate(); // just to be sure I guess .. check if the crystal aren't dead. // dunno if this can ever happen (geo)? for (int i =0; i < 8; i++) { if (!crystal[i]->exists()) { tw_error("A crystal died - should not happen !!"); } } } ChmmrBattleshipMissile::ChmmrBattleshipMissile(SpaceLocation *creator, double ox, double oy, double oangle, double ov, int odamage, double orange, int oarmour, SpaceSprite *osprite) : Missile(creator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, creator, osprite) { explosionSprite = data->spriteWeaponExplosion; explosionFrameCount = 10; explosionFrameSize = 50; } void ChmmrBattleshipMissile::inflict_damage(SpaceObject *other) { STACKTRACE; Missile::inflict_damage(other); if (other && other->exists()) add(new ChmmrBattleshipMarker(this, other)); } ChmmrBattleshipMarker::ChmmrBattleshipMarker(SpaceLocation *creator, SpaceObject *oo) : SpaceLocation(creator, 0, 0), o(oo) { id = jnk_marker_id; layer = LAYER_SPECIAL; collide_flag_anyone = 0; collide_flag_sameteam = 0; collide_flag_sameship = 0; calculate(); } void ChmmrBattleshipMarker::calculate() { STACKTRACE; if (state == 0) return; pos = o->normal_pos(); // dunno if the absence of this could cause something strange ... perhaps it does? // maybe "some" routine needs to access its "ship" pointer sometime ? SpaceLocation::calculate(); if (!(o && o->exists())) { o = 0; state = 0; return; } } ChmmrBattleshipLaser::ChmmrBattleshipLaser (SpaceLocation *creator, double langle, double mangle, int lcolor, double lrange, int ldamage, int lfcount, SpaceLocation *opos, SpaceObject *otgt, double oaim, double spread) : Laser(creator, langle, lcolor, lrange, 1, lfcount/ldamage, opos, 0, 0) { // collide_flag_sameteam = 0; // collide_flag_sameship = 0; target = NULL; ship = NULL; power_left = ldamage-1; tgt = otgt; aim = oaim; max_angle = mangle; lng = length; base_length = length; double r = random(-spread, spread); angle = normalize(angle + r, PI2); d_a = 0; } void ChmmrBattleshipLaser::calculate() { STACKTRACE; if (!(lpos && lpos->exists())) { lpos = 0; state = 0; } if (state == 0) return; if (frame < frame_count) { frame += frame_time; } else { if (!(tgt && tgt->exists())) { tgt = 0; state = 0; return; } frame = 0; if (power_left > 0) { damage_factor = 1; power_left--; } else tgt = NULL; } double alpha; pos = lpos->normal_pos() + rotate(rel_pos, lpos->get_angle() - PI/2); vel = lpos->get_vel(); if (sinc_angle) angle = normalize(lpos->get_angle() + relative_angle, PI2); if (tgt) { if (!tgt->exists()) tgt = NULL;} else tgt = NULL; if (tgt) d_a = normalize(trajectory_angle(tgt) - angle, PI2); else { base_length = lng * (frame_count - frame) / frame_count; } length = base_length; SpaceLine::calculate(); if (d_a > PI) d_a -= PI2; alpha = aim * frame_time; if (fabs(d_a) < alpha) alpha = fabs(d_a); if (d_a > 0) angle += alpha; else angle -= alpha; d_a = normalize(lpos->get_angle() - angle, PI2); if (d_a > PI) d_a -= PI2; if (fabs(d_a) > max_angle) tgt = NULL; // angle = pos->get_angle() - max_angle * d_a / fabs(d_a); } void ChmmrBattleshipLaser::inflict_damage(SpaceObject *other) { STACKTRACE; // return; if (damage_factor < 0) return; int i; i = iround(damage_factor / 2); if(i >= BOOM_SAMPLES) i = BOOM_SAMPLES - 1; play_sound((SAMPLE *)(melee[MELEE_BOOM + i].dat)); damage(other, damage_factor, 0); damage_factor = -1; // collide_flag_anyone = collide_flag_sameship = collide_flag_sameteam = 0; // return; add(new Animation( this, normal_pos() + edge(), meleedata.sparkSprite, 0, SPARK_FRAMES, 50, LAYER_EXPLOSIONS)); return; } REGISTER_SHIP(ChmmrBattleship) --- NEW FILE: shpsacda.cpp --- /* $Id: shpsacda.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" #include "../util/aastr.h" #include "../melee/mview.h" #include "../frame.h" REGISTER_FILE class SacreeDagger : public Ship { public: IDENTITY(SacreeDagger); double weaponRange, weaponDamage, weaponFrameCount; double specialRange; double specialVelocity; double specialDamage; double specialArmour; double specialRecoil; public: SacreeDagger(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); }; class SacreeDaggerBeam : public SpaceLine { public: IDENTITY(SacreeDaggerBeam); protected: int frame, frame_count; double relative_angle; SpaceLocation *lpos; Vector2 rel_pos; double damage_shots; double base_length; bool got_spark; public: SacreeDaggerBeam(SpaceLocation *creator, Vector2 rpos, double lrange, double ldamage, int lfcount, double oangle); virtual void calculate(); virtual void inflict_damage(SpaceObject *other); virtual void animate(Frame *space); }; class SacreeDaggerShot : public Missile { public: IDENTITY(SacreeDaggerShot); protected: int s_ind; public: SacreeDaggerShot(SpaceLocation *creator, Vector2 opos, double oangle, double ov, double odamage, double orange, double oarmour, SpaceSprite *osprite); virtual void animate(Frame *space); }; SacreeDagger::SacreeDagger(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); weaponDamage = get_config_float("Weapon", "Damage", 0); weaponFrameCount = get_config_int("Weapon", "FrameCount", 0); specialRange = scale_range(get_config_float("Special", "Range", 0)); specialVelocity = scale_velocity(get_config_float("Special", "Velocity", 0)); specialDamage = get_config_float("Special", "Damage", 0); specialArmour = get_config_float("Special", "Armour", 0); specialRecoil = scale_velocity(get_config_float("Special", "Recoil", 0)); } int SacreeDagger::activate_weapon() { STACKTRACE game->add(new SacreeDaggerBeam(this, Vector2(0,30), weaponRange, weaponDamage, iround(weaponFrameCount), angle)); return true; } int SacreeDagger::activate_special() { STACKTRACE game->add(new SacreeDaggerShot(this, Vector2(0,55), angle, specialVelocity, specialDamage, specialRange, specialArmour, data->spriteSpecial)); //game->add(new SacreeDaggerBeam(this, Vector2(15,9), 43.5, 0, 50, angle-19.5*ANGLE_RATIO)); //game->add(new SacreeDaggerBeam(this, Vector2(-15,9), 43.5, 0, 50, angle+19.5*ANGLE_RATIO)); accelerate(this, -unit_vector(angle)*specialRecoil, speed_max); return true; } SacreeDaggerBeam::SacreeDaggerBeam(SpaceLocation *creator, Vector2 rpos, double lrange, double ldamage, int lfcount, double oangle) : SpaceLine(creator, creator->normal_pos(), oangle, lrange, 0), frame(0), frame_count(lfcount), lpos(creator), rel_pos(rpos) { if (ldamage <= 0) collide_flag_anyone = 0; set_depth(DEPTH_SHOTS); base_length = length; rel_pos.x *= -1; pos = normalize(pos + rotate(rel_pos, -PI/2+lpos->get_angle())); vel = lpos->get_vel(); id |= SPACE_LASER; damage_factor = ldamage; int rrr = tw_random(85); color = makecol(100+rrr,100+rrr+tw_random(55),205+tw_random(51)); relative_angle = angle - lpos->get_angle(); got_spark = false; } void SacreeDaggerBeam::calculate() { STACKTRACE if((frame < frame_count) && (lpos->exists())) { length = base_length; pos = lpos->normal_pos() + rotate(rel_pos, lpos->get_angle() - PI/2); vel = lpos->get_vel(); // angle = lpos->get_angle(); angle = normalize(lpos->get_angle() + relative_angle, PI2); SpaceLine::calculate(); frame += frame_time; } else state = 0; int rrr = tw_random(85); color = makecol(100+rrr,100+rrr+tw_random(55),205+tw_random(51)); } void SacreeDaggerBeam::inflict_damage(SpaceObject *other) { STACKTRACE damage(other, damage_factor*frame_time/frame_count); int aa = get_tw_aa_mode(); if (!((aa & AA_BLEND) && (aa & AA_ALPHA) && (!got_spark) && !(aa & AA_NO_AA))) { physics->add(new Animation( this, pos + edge(), meleedata.sparkSprite, 0, SPARK_FRAMES, 50, DEPTH_EXPLOSIONS)); got_spark = true; } return; } void SacreeDaggerBeam::animate(Frame *space) { STACKTRACE int aa = get_tw_aa_mode(); SpaceLine::animate(space); if ((aa & AA_BLEND) && (aa & AA_ALPHA) && !(aa & AA_NO_AA) && (length < base_length*0.9999) && (target)) { int _old_trans = aa_get_trans(); // changed tw_random into rand - GEO - so that physics are not affected by the animation aa_set_trans(rand()%136); //graphics data->spriteWeaponExplosion->animate(pos+edge(), 0, space); aa_set_trans(_old_trans); } } SacreeDaggerShot::SacreeDaggerShot(SpaceLocation *creator, Vector2 opos, double oangle, double ov, double odamage, double orange, double oarmour, SpaceSprite *osprite) : Missile(creator, opos, oangle, ov, odamage, orange, oarmour, creator, osprite) { explosionSprite = data->spriteSpecialExplosion; explosionFrameCount = 20; explosionFrameSize = 25; explosionSample = data->sampleSpecial[1]; s_ind = 0; add(new Animation(this, pos, data->spriteExtra, 0, data->spriteExtra->frames(), 25, DEPTH_HOTSPOTS+0.25)); } void SacreeDaggerShot::animate(Frame *space) { STACKTRACE; int k; k = sprite_index + 64 * s_ind; int n = sprite->frames(); if ( k >= n) { tw_error("sprite index error in %s", get_identity() ); } sprite->animate(pos, k, space); s_ind = (s_ind + 1) % 2; } REGISTER_SHIP(SacreeDagger) --- NEW FILE: shpfweav.cpp --- /* $Id: shpfweav.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" REGISTER_FILE #include "../sc1ships.h" class FweiksAvian : public Ship { public: IDENTITY(FweiksAvian); public: double weaponTime; double weaponVelocity; int weaponDamage; int weaponArmour; double specialTime; double specialVelocity; int specialDamage; int specialArmour; public: FweiksAvian(Vector2 opos, double angle, ShipData *data, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); }; class FweiksCrystal : public TimedShot { public: IDENTITY(FweiksCrystal); public: FweiksCrystal(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, double ovel, double otime, double oarmour, double odamage); virtual void inflict_damage(SpaceObject *other); }; class FweiksFeather : public TimedShot { public: IDENTITY(FweiksFeather); double vref, period, angle0; double alpha, dalpha; public: FweiksFeather(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, double ovel, double otime, double oarmour, double odamage, double perturbedangle); virtual void calculate(); }; FweiksCrystal::FweiksCrystal(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, double ovel, double otime, double oarmour, double odamage) : TimedShot(creator, orelpos, orelangle, osprite, ovel, otime, oarmour, odamage) { // it needs mass, otherwise it won't bounce off. mass = 0.1; } void FweiksCrystal::inflict_damage(SpaceObject *other) { STACKTRACE if (!state) return; TimedShot::inflict_damage(other); // don't die, just bounce (so, override the state=0 thingy in timedshot). state = 1; } FweiksFeather::FweiksFeather(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, double ovel, double otime, double oarmour, double odamage, double perturbedangle) : TimedShot(creator, orelpos, orelangle, osprite, ovel, otime, oarmour, odamage) { vref = ovel; angle0 = angle; period = 1.0; alpha = perturbedangle; // perturbed position. dalpha = 0; // at rest } void FweiksFeather::calculate() { STACKTRACE // the velocity of a falling feather is ... somewhat weird. /* Vector2 vchange; double si, co; si = sin(PI2 * existtime / period); co = cos(PI2 * existtime / period); vchange = vref * Vector2(2*(fabs(si)-0.2), co); int k; k = existtime / period; */ // pendulum? double dt, g, R; dt = frame_time * 1E-3; g = 1.0; R = 0.1; dalpha += (g/R) * sin(alpha) * dt; alpha += dalpha * dt; //vel = vref*unit_vector(angle0) + rotate( vchange, angle0 ); vel = Vector2(0.1, 0); vel += R*dalpha * unit_vector(alpha-PI/2); vel = vref * rotate( vel, angle0 ); TimedShot::calculate(); } FweiksAvian::FweiksAvian(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { weaponTime = get_config_float("Weapon", "Time", 0); weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); weaponDamage = get_config_int("Weapon", "Damage", 0); weaponArmour = get_config_int("Weapon", "Armour", 0); specialTime = get_config_float("Special", "Time", 0); specialVelocity = scale_velocity(get_config_float("Special", "Velocity", 0)); specialDamage = get_config_int("Special", "Damage", 0); specialArmour = get_config_int("Special", "Armour", 0); } int FweiksAvian::activate_weapon() { STACKTRACE //creator, orelpos, orelangle, osprite, ovel, otime, oarmour, odamage TimedShot *tmp = new FweiksCrystal( this, Vector2(0.0, size.y / 1.5), 0.0, data->spriteWeapon, weaponVelocity, weaponTime, weaponArmour, weaponDamage); add(tmp); // tmp->explosionSprite = data->spriteWeaponExplosion; // tmp->explosionSample = 0; // tmp->explosionFrameCount = data->spriteWeaponExplosion->frames(); // tmp->explosionFrameSize = 100; return(TRUE); } int FweiksAvian::activate_special() { STACKTRACE int i; for ( i = -1; i < 2; ++i ) { if (i == 0) continue; FweiksFeather *tmp = new FweiksFeather( this, Vector2(0.0, -size.y / 1.5), PI*(1+0.1*i), data->spriteSpecial, specialVelocity, specialTime, specialArmour, specialDamage, i*0.4*PI); add(tmp); } // tmp->explosionSprite = data->spriteSpecialExplosion; // tmp->explosionSample = 0; // tmp->explosionFrameCount = data->spriteSpecialExplosion->frames(); // tmp->explosionFrameSize = 100; return(TRUE); } REGISTER_SHIP ( FweiksAvian ) --- NEW FILE: shpostor.cpp --- /* $Id: shpostor.cpp,v 1.1 2006/01/29 16:14:34 geomannl Exp $ */ #include "../ship.h" #include "../melee/mview.h" #include "../frame.h" REGISTER_FILE /** Copy of the Gerbillian Orion */ class OstokOrionWarhead; class OstokOrion : public Ship { public: IDENTITY(OstokOrion); double weaponRange; double weaponVelocity1; double weaponMaxSpeed; int weaponDamage1; int weaponDamage2; int weaponArmour1; int weaponArmour2; double weaponRelativity; int weaponFramesToIgnition; int weaponFramesOfThrust; int weaponFramesOfCoasting; double weaponAcceleration; double weaponReleaseAngle1; double weaponReleaseAngle2; double weaponHotspotRate; double weaponMass; double weaponAngleIncrement; int weaponAllLaunch; bool bWiggle; int bombLifetime; double bombDamage, bombArmour; double bombBlastRange, bombKick, bombVelocity, boost_max; double bombExplodeDist; double safeAngle; OstokOrionWarhead* bomb; public: OstokOrion(Vector2 opos, double angle, ShipData *data, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); virtual void calculate(); }; // *********************************************** /* The Koanua Missle */ class OstokOrionMissile : public Missile { public: IDENTITY(OstokOrionMissile); private: bool isBurning; bool isCoasting; int side; double period, rotatetime, accel; double offset; double hotspot_frame; public: OstokOrionMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite, int side, bool bWiggle); Ship* creator; bool bWiggle; double hotspot_rate; double facingAngle; double framesToIgnition; double acceleration; double mass; double ignitionSpeed; double framesOfBurn; double framesOfCoasting; double maxSpeed; double damageAfterIgnition; double armourAfterIgnition; void calculate(void); }; // *********************************************** class OstokOrionWarheadExplosion : public Presence { public: IDENTITY(OstokOrionWarheadExplosion); protected: Vector2 *xp, *xv; int num, lifetime, life_counter, color; public: OstokOrionWarheadExplosion(); OstokOrionWarheadExplosion(Vector2 opos, double ov, int onum, int olife, int ocolor); virtual void calculate(); virtual void animate(Frame *space); virtual ~OstokOrionWarheadExplosion(); }; // *********************************************** class OstokOrionWarheadExplosion2 : public OstokOrionWarheadExplosion { public: IDENTITY(OstokOrionWarheadExplosion2); public: OstokOrionWarheadExplosion2(Vector2 opos, double ov, int onum, int olife, int ocolor, SpaceObject* otarg); }; // *********************************************** class OstokOrionWarhead : public Missile { public: IDENTITY(OstokOrionWarhead); double blast_range, old_range; double blast_damage, kick, lifetime, boost_max; double safe_range; double safeAngle; double hotspot_rate; SpaceLocation* myShip; bool active; public: OstokOrionWarhead (SpaceLocation *creator, Vector2 rpos, double ov, double oangle, double odamage, double oarmour, SpaceSprite *osprite, double oblast_range, int olifetime, double okick, double oblast_max, double osafeAngle, double osafe_range); virtual void calculate(); virtual void animateExplosion(); }; // *********************************************** OstokOrion::OstokOrion(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { bombLifetime = int(get_co... [truncated message content] |
From: Rob <geo...@us...> - 2006-01-29 16:14:43
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/newships Modified Files: shpnarlu.cpp shppanav.cpp shpstrsc.cpp Log Message: Index: shpstrsc.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpstrsc.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpstrsc.cpp 2 Aug 2005 00:23:47 -0000 1.14 --- shpstrsc.cpp 29 Jan 2006 16:14:34 -0000 1.15 *************** *** 13,17 **** REGISTER_FILE ! int MAX_TARGETS=3; //Target structure, includes Ship * and Time_Count. --- 13,17 ---- REGISTER_FILE ! static int MAX_TARGETS=3; //Target structure, includes Ship * and Time_Count. *************** *** 22,27 **** }; ! int specialMode; //Beacon behavior(0=old, 1=new); ! int specialMulti; class StrivanarScrutinizer : public Ship { --- 22,27 ---- }; ! static int specialMode; //Beacon behavior(0=old, 1=new); ! static int specialMulti; class StrivanarScrutinizer : public Ship { Index: shppanav.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shppanav.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shppanav.cpp 2 Aug 2005 00:23:46 -0000 1.12 --- shppanav.cpp 29 Jan 2006 16:14:34 -0000 1.13 *************** *** 30,49 **** - class TimedShot : public SpaceObject - { - public: - IDENTITY(TimedShot); - public: - double armour; - double existtime, maxtime; - - TimedShot(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, - double ovel, double otime, double oarmour, double odamage); - - virtual void calculate(); - - virtual void inflict_damage(SpaceObject *other); - virtual int handle_damage(SpaceLocation *source, double normal, double direct); - }; --- 30,33 ---- *************** *** 77,162 **** - TimedShot::TimedShot(SpaceLocation *creator, Vector2 orelpos, double orelangle, SpaceSprite *osprite, - double ovel, double otime, double oarmour, double odamage) - : - SpaceObject(creator, 0, 0, osprite), - armour(oarmour), - existtime(0), - maxtime(otime) - { - angle = creator->angle + orelangle; - pos = creator->pos + rotate(orelpos, creator->angle - PI/2); - vel = ovel * unit_vector(angle); - - layer = LAYER_SHOTS; - - collide_flag_anyone = ALL_LAYERS; - collide_flag_sameteam = ALL_LAYERS; - collide_flag_sameship = 0; - - damage_factor = odamage; - - isblockingweapons = false; - attributes &= ~ATTRIB_STANDARD_INDEX; - } - - void TimedShot::calculate() - { - STACKTRACE - SpaceObject::calculate(); - - if (!(ship && ship->exists())) - { - state = 0; - return; - } - - if (existtime >= maxtime) - { - state = 0; - return; - } - - existtime += frame_time * 1E-3; - - // always orient the shot in the direction of movement. - angle = vel.angle(); - sprite_index = get_index(angle); - } - - void TimedShot::inflict_damage(SpaceObject *other) - { - STACKTRACE - // copied from Shot::infli... - - if (!other->exists()) return; - - damage(other, damage_factor); - - //if (!other->isShot()) state = 0; - if (other->isblockingweapons) state = 0; - - if (state == 0) - { - //animateExplosion(); - //soundExplosion(); - } - - } - - int TimedShot::handle_damage(SpaceLocation *source, double normal, double direct) - { - STACKTRACE - armour -= (normal + direct); - - if (armour <= 0) - { - armour = 0; - state = 0; - } - - return true; - } - --- 61,64 ---- Index: shpnarlu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpnarlu.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** shpnarlu.cpp 15 Sep 2005 09:01:37 -0000 1.20 --- shpnarlu.cpp 29 Jan 2006 16:14:34 -0000 1.21 *************** *** 12,15 **** --- 12,19 ---- #include <stdlib.h> + #include "../other/lightning.h" + + + class NaroolPoison; *************** *** 28,31 **** --- 32,37 ---- int cloak_frame; + Lightning lightning; + public: *************** *** 35,39 **** ShipData *shipData, unsigned int code); - BITMAP *lightningbmp; virtual ~NaroolLurker(); --- 41,44 ---- *************** *** 46,52 **** virtual void animate(Frame *space); - void calc_lightning(); - double maxsparktime, sparktime, Rmax; - Vector2 sparkpos; virtual void inflict_damage(SpaceObject *other); --- 51,54 ---- *************** *** 104,128 **** BITMAP *shpbmp = sprite->get_bitmap(0); ! int bpp = bitmap_color_depth(shpbmp); ! lightningbmp = create_bitmap_ex(bpp, shpbmp->w, shpbmp->h); ! clear_to_color(lightningbmp, makeacol(0,0,0,255)); ! //maxsparktime = 2000; ! maxsparktime = get_config_float("Quirk", "maxsparktime", 2000); ! sparktime = maxsparktime; ! sparkpos = 0.5 * Vector2(lightningbmp->w,lightningbmp->h); - Rmax = get_config_float("Quirk", "Rmax", 1); } NaroolLurker::~NaroolLurker() { ! if (lightningbmp) ! destroy_bitmap(lightningbmp); } ! double NaroolLurker::isInvisible() const { ! if (cloak_frame >= 300 ! && sparktime <= 0) return(1); ! return 0; } --- 106,127 ---- BITMAP *shpbmp = sprite->get_bitmap(0); ! double maxsparktime = get_config_float("Quirk", "maxsparktime", 2000); ! double Rmax = get_config_float("Quirk", "Rmax", 1); ! lightning.init(shpbmp, 0, maxsparktime, Rmax); ! } NaroolLurker::~NaroolLurker() { ! } ! double NaroolLurker::isInvisible() const ! { ! if ( (cloak_frame >= 300) && (!lightning.visible()) ) ! return 1; ! else ! return 0; } *************** *** 191,198 **** ! if (sparktime > 0) ! sparktime -= frame_time; ! else ! sparktime = 0; } --- 190,194 ---- ! lightning.update(frame_time); } *************** *** 209,214 **** sprite->animate_character( pos, sprite_index, pallete_color[0], space); - //Vector2 lightningrelpos = 0.5 * Vector2(lightningbmp->w,lightningbmp->h); - calc_lightning(); // aa_set_mode(find_aa_mode(general_attributes)); --- 205,208 ---- *************** *** 218,242 **** P = corner(pos, sprite->size(0)); ! int ix, iy, iw, ih; ! // target position ! ix = iround(P.x); ! iy = iround(P.y); ! // target size ! iw = iround(S.x); ! ih = iround(S.y); ! ! //int a; ! //a = aa_get_trans(); ! //aa_set_trans(128); ! ! int a; ! a = aa_get_mode(); ! aa_set_mode(a | AA_ALPHA); ! aa_stretch_blit(lightningbmp, space->surface, ! 0, 0,lightningbmp->w,lightningbmp->h, ! ix, iy, iw, ih); ! aa_set_mode(a); ! ! space->add_box(ix, iy, iw, ih); } else --- 212,217 ---- P = corner(pos, sprite->size(0)); ! lightning.draw(space, P, S); ! } else *************** *** 364,368 **** //you've hit something; activate sparks. ! sparktime = maxsparktime; // but, where did you hit it ? --- 339,343 ---- //you've hit something; activate sparks. ! lightning.reset(); // but, where did you hit it ? *************** *** 371,497 **** a = trajectory_angle(other); R = 40; ! sparkpos = R * unit_vector(a); ! sparkpos += 0.5 * Vector2(lightningbmp->w,lightningbmp->h); } - void NaroolLurker::calc_lightning() - { - STACKTRACE - - Vector2 P; - P = sparkpos; - - //return; - //clear_to_color(lightningbmp, makeacol(0,0,0,255)); - //circlefill(lightningbmp, P.x, P.y, 10, makeacol(255,0,0,200)); - - // first, let the image grow fainter - BITMAP *b; - b = lightningbmp; - int ix, iy; - int iw, ih; - iw = b->w; - ih = b->h; - - BITMAP *shpbmp; - shpbmp = sprite->get_bitmap(sprite_index); - - - - // assume it's a 32 bit image ... - unsigned char *a; - - for ( iy = 0; iy < ih; ++iy ) - { - a = (unsigned char*) b->line[iy]; - a += 0; // red = the 3rd color (in my case). - - for ( ix = 0; ix < iw; ++ix ) - { - // reduce colors - int i; - for ( i = 0; i < 3; ++i ) - { - if (*a > 5) - (*a) -= 5; - else - (*a) = 0; - - ++a; - } - - ++a; - } - } - - if (sparktime > 0) - { - // create some kind of lightning now ? How ? - int i, N; - - N = 5 + rand() % 5; //graphics - - double ang, R; - ang = (rand() % 360) * PI/180; //graphics - - for ( i = 0; i < N; ++i ) - { - double dx, dy; - //dx = (random(double(iw)) - 0.5*iw) / N; - //dy = (random(double(ih)) - 0.5*ih) / N; - - ang += (rand() % 180 - 90) * PI/180; //graphics - R = (rand() % int(Rmax+1)) / N; //graphics - dx = R * cos(ang); - dy = R * sin(ang); - - - int j, M; - M = 10; - for ( j = 0; j < M; ++j ) - { - P.x += dx / M; - P.y += dy / M; - - int col; - int re, gr, bl; - - col = getpixel(shpbmp, iround(P.x), iround(P.y)); - - re = getr(col); - gr = getg(col); - bl = getb(col); - - if ( !(re == 255 && gr == 0 && bl == 255)) - { - int k; - k = iround(128*(0.5 + 0.5*sparktime/maxsparktime)); - - // re = 0; - // bl = 0; - // if ( k > 96) - // re = k + 127 / (i+1); - // else - // bl = k + 127 / (i+1); - - double c, f; - //f = (0.5 + (0.5*sparktime)/maxsparktime); - f = sparktime / maxsparktime; - c = 255;// / (i+1); - re = iround(f * c); - bl = iround((1-f) * c); - - putpixel(b, iround(P.x), iround(P.y), makeacol(re,0,bl,255)); - } - } - - } - } - - - - } - REGISTER_SHIP(NaroolLurker) --- 346,354 ---- a = trajectory_angle(other); R = 40; ! ! lightning.locate(R * unit_vector(a)); } REGISTER_SHIP(NaroolLurker) |
From: Rob <geo...@us...> - 2006-01-29 16:14:42
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/util Modified Files: errors.cpp Log Message: Index: errors.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/errors.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** errors.cpp 5 Oct 2005 20:21:28 -0000 1.15 --- errors.cpp 29 Jan 2006 16:14:34 -0000 1.16 *************** *** 244,247 **** --- 244,248 ---- ) { + char error_string[4096]; int i; *************** *** 434,441 **** { - #ifdef _DEBUG - // in debug mode, crash right away, that is much easier. - *(int*)0 = 0; - #endif char error_string[4096]; --- 435,438 ---- |
From: Rob <geo...@us...> - 2006-01-29 16:14:41
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source Modified Files: melee.h scp.cpp Log Message: Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** scp.cpp 1 Aug 2005 10:46:35 -0000 1.74 --- scp.cpp 29 Jan 2006 16:14:33 -0000 1.75 *************** *** 2524,2527 **** --- 2524,2569 ---- bool safeToDrawPreview = false; + static ShipType* showing_shipimage_type = 0; + + static int rotationFrame = 0; + + void add_ship_image(int k) + { + // show a new ship image. + ShipType* type = reference_fleet->getShipType(k); + + if (type && type->data) + { + type->data->lock(); + + if (type->data->spriteShip) + rotationFrame = 0;//(int)(fractionRotated * type->data->spriteShip->frames()); + + showing_shipimage_type = type; + } + } + + void remove_ship_image() + { + if (showing_shipimage_type) + { + // if some image was shown, then you should remove/dereference it. + + safeToDrawPreview = false; + + ShipType* type = showing_shipimage_type; + + if (type && type->data) + { + type->data->unlock(); + + showing_shipimage_type = 0; + } + + } + } + + + // FLEET - dialog function void edit_fleet(int player) {STACKTRACE *************** *** 2532,2535 **** --- 2574,2580 ---- bool availableFleetDirty = true; + // reset the ship image ? + showing_shipimage_type = 0; + static Fleet::SortingMethod sortMethod1 = (Fleet::SortingMethod) Fleet::SORTING_METHOD_DEFAULT, sortMethod2 = (Fleet::SortingMethod) Fleet::SORTING_METHOD_DEFAULT; *************** *** 2754,2757 **** --- 2799,2804 ---- // reference_fleet = old_reference_fleet; + remove_ship_image(); + fleet->save("fleets.ini", tmp); delete fleet; *************** *** 2759,2763 **** } - int scp_fleet_dialog_text_list_proc(int msg, DIALOG* d, int c) { --- 2806,2809 ---- *************** *** 2818,2822 **** static BITMAP * sprite = create_bitmap(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w, fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h); - static int rotationFrame = 0; if (!sprite || !panel) --- 2864,2867 ---- *************** *** 2824,2848 **** //selection has changed ! if (d->d1 != old_d1) { ! safeToDrawPreview = false; ! float fractionRotated = 0; ! {ShipType* type = reference_fleet->getShipType(old_d1); ! if (type && type->data) { ! if (type->data->spriteShip) { ! fractionRotated = (float)((float)rotationFrame / (float)(type->data->spriteShip->frames())); ! } ! type->data->unlock(); ! }} ! ! rotationFrame = 0; ! ! {ShipType* type = reference_fleet->getShipType(d->d1); ! if (type && type->data) { ! type->data->lock(); ! if (type->data->spriteShip) ! rotationFrame = (int)(fractionRotated * type->data->spriteShip->frames()); ! }} } --- 2869,2879 ---- //selection has changed ! // (or nothing is shown, yet) ! if (d->d1 != old_d1 || !showing_shipimage_type) ! { ! remove_ship_image(); ! add_ship_image(d->d1); } Index: melee.h =================================================================== RCS file: /cvsroot/timewarp/source/melee.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** melee.h 27 Sep 2005 22:03:55 -0000 1.28 --- melee.h 29 Jan 2006 16:14:33 -0000 1.29 *************** *** 460,470 **** //xxx spacesprite test SpaceSprite(const DATAFILE *sprites, int sprite_count, int attributes = -1, int rotations = 1); SpaceSprite(BITMAP *image, int _attributes = -1); SpaceSprite(SpaceSprite &old); - // SpaceSprite(const char *sourcename, const char *spritename); - // added GEO (should be deleted) - // SpaceSprite::SpaceSprite(char *bmpfilename, int _attributes); - // added GEO - SpaceSprite::SpaceSprite(BITMAP **bmplist, int sprite_count, int rotations, int _attributes); virtual ~SpaceSprite(); --- 460,466 ---- //xxx spacesprite test SpaceSprite(const DATAFILE *sprites, int sprite_count, int attributes = -1, int rotations = 1); + SpaceSprite::SpaceSprite(BITMAP **bmplist, int sprite_count, int _attributes, int rotations); SpaceSprite(BITMAP *image, int _attributes = -1); SpaceSprite(SpaceSprite &old); virtual ~SpaceSprite(); *************** *** 579,582 **** --- 575,579 ---- void unload_unused_ship_data() ; + /** is responsible for reading/removing raw data related to ships: sprites and sounds. It does not read ship-settings. */ class ShipData { enum { *************** *** 592,599 **** void lock(); void unlock(); void load(); void unload(); bool islocked(); ! DATAFILE *data; // int num_panel_bitmaps; // Surface **bitmapPanel; --- 589,600 ---- void lock(); void unlock(); + void load(); + void load_datafile(DATAFILE *file); + void load_directory(char *dirname); + void unload(); bool islocked(); ! // int num_panel_bitmaps; // Surface **bitmapPanel; |
From: Rob <geo...@us...> - 2006-01-29 16:14:41
|
Update of /cvsroot/timewarp/source/gamex/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/gamex/general Modified Files: sprites.cpp Log Message: Index: sprites.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/general/sprites.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sprites.cpp 24 Mar 2004 23:51:36 -0000 1.9 --- sprites.cpp 29 Jan 2006 16:14:33 -0000 1.10 *************** *** 247,352 **** - // all the sprite-relevant information (and nothing else). - SpaceSprite::SpaceSprite(BITMAP **bmplist, int sprite_count, int rotations, int _attributes) - { - count = sprite_count * rotations; - - int i, j, obpp; - BITMAP *bmp, *tmp = NULL; - - if (_attributes == -1) _attributes = string_to_sprite_attributes(NULL); - - references = 0; - highest_mip = 0; - for (i = 1; i < MAX_MIP_LEVELS; i += 1) { - b[i] = NULL; - } - - general_attributes = _attributes; - if (general_attributes & MATCH_SCREEN_FORMAT) { - bpp = videosystem.bpp; - if (general_attributes & ALPHA) { - if (bpp <= 16) bpp = 16; - else bpp = 32; - bpp = 32; - } - } - else bpp = 0; - - w = bmplist[0]->w; - h = bmplist[0]->h; - obpp = bitmap_color_depth(bmplist[0]); - - if (bpp == 0) bpp = obpp; - if (obpp != bpp) tmp = create_bitmap_ex(obpp, w, h); - if (general_attributes & ALPHA) { - if (bpp <= 16) bpp = 16; - else bpp = 32; - } - - - m = new PMASK*[count]; - b[0] = new BITMAP* [count]; - attributes = new char [count]; - - for(i = 0; i < sprite_count; i += 1) - { - - bmp = create_bitmap_ex(bpp, bmplist[i]->w, bmplist[i]->h); - if (!tmp) tmp = bmp; - if (general_attributes & MASKED) - clear_to_color(bmp, bitmap_mask_color(bmp)); - - if (tmp != bmp) clear_to_color(tmp, bitmap_mask_color(tmp)); - - // if (general_attributes & ALPHA) - // handle_alpha_load((BITMAP *)(images[i].dat)); - - if (obpp != bpp) - { - convert_bitmap(bmplist[i], bmp, (general_attributes & MASKED) ? AA_MASKED : 0); - } else { - if (general_attributes & MASKED) - draw_sprite(bmp, bmplist[i], 0, 0); - - else blit(bmplist[i], bmp, 0, 0, 0, 0, bmp->w, bmp->h); - } - - color_correct_bitmap(bmp, general_attributes & MASKED); - - // make_alpha(bmp); - - if (tmp == bmp) tmp = NULL; - - for (j = 1; j < rotations; j += 1) - { - BITMAP *tmp = create_bitmap_ex(bpp, bmp->w, bmp->h); - clear_to_color(tmp, bitmap_mask_color(tmp)); - rotate_sprite(tmp, bmp, 0, 0, j * ((1<<24)/rotations)); - - // also replace the color ZERO with a transparancy color (why: I dislike bright pink) - replace_color(tmp, 0, makecol_depth(bitmap_color_depth(tmp), 255, 0, 255)); - - m[j + (i * rotations)] = create_allegro_pmask(tmp); - b[0][j + (i * rotations)] = tmp; - attributes[j + (i * rotations)] = DEALLOCATE_IMAGE | DEALLOCATE_MASK; - - } - - // also replace the color ZERO with a transparancy color (why: I dislike bright pink) - replace_color(bmp, 0, makecol_depth(bitmap_color_depth(bmp), 255, 0, 255)); - - m[(i * rotations)] = create_allegro_pmask(bmp); - b[0][(i * rotations)] = bmp; - attributes[(i * rotations)] = DEALLOCATE_IMAGE | DEALLOCATE_MASK; - - } - - if (general_attributes & MIPMAPED) { - generate_mipmaps(); - } - } - - --- 247,250 ---- |
From: Rob <geo...@us...> - 2006-01-29 16:14:41
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/source/ais Modified Files: c_wussie.cpp Log Message: Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** c_wussie.cpp 23 Sep 2005 13:11:12 -0000 1.27 --- c_wussie.cpp 29 Jan 2006 16:14:33 -0000 1.28 *************** *** 676,692 **** field_fire = TRUE; ! // intercept time along the ship orientation (line of sight) ! double t_intercept; ! if (weapon_vel > target_vel) ! t_intercept = distance / (weapon_vel - target_vel); // weapon_vel includes correction for weapon relativity ! else ! t_intercept = 1E6; ! // intercept distance along the line of sight ! double d_intercept; ! d_intercept = t_intercept * weapon_vel; ! //xxx this does not take relativity into account ? ! bool weapon_in_range = (option_range[state][j]+0.5*ship->size.x > 1.0 * d_intercept); --- 676,702 ---- field_fire = TRUE; ! bool weapon_in_range; ! if (fabs (angle_fire) < sweep[j])// && distance < option_range[state][j]) ! { ! // first check, if the weapon has the correct angle and distance... ! //weapon_in_range = true; ! // otherwise, make a more complex check... ! ! // intercept time along the ship orientation (line of sight) ! double t_intercept; ! if (weapon_vel > target_vel) ! t_intercept = distance / (weapon_vel - target_vel); // weapon_vel includes correction for weapon relativity ! else ! t_intercept = 1E6; ! ! // intercept distance along the line of sight ! double d_intercept; ! d_intercept = t_intercept * weapon_vel; ! //xxx this does not take relativity into account ? ! ! weapon_in_range = (option_range[state][j]+0.5*ship->size.x > 1.0 * d_intercept); ! } *************** *** 709,712 **** --- 719,725 ---- if ( rD < rV * out_of_range_multiplier ) // out of range condition dontfireoption[j] = TRUE; + + + //if (j == 0)// && weapon_in_range) *************** *** 725,730 **** if (j == 0) { ! if ((fabs (angle_fire) < sweep[j]) && ! weapon_in_range ) fireoption[0] = TRUE; } --- 738,742 ---- if (j == 0) { ! if (weapon_in_range ) fireoption[0] = TRUE; } *************** *** 773,777 **** if (distance < option_range[state][j]) dontfireoption[j] = TRUE; ! else fireoption[j] = TRUE; // added... is needed for mrmrm state-change range_fire = FALSE; --- 785,789 ---- if (distance < option_range[state][j]) dontfireoption[j] = TRUE; ! else if (weapon_in_range) fireoption[j] = TRUE; // added... is needed for mrmrm state-change range_fire = FALSE; *************** *** 782,786 **** if (distance > option_range[state][j]) dontfireoption[j] = TRUE; ! else fireoption[j] = TRUE; // added... is needed for mrmrm state-change range_fire = TRUE; --- 794,798 ---- if (distance > option_range[state][j]) dontfireoption[j] = TRUE; ! else if (weapon_in_range) fireoption[j] = TRUE; // added... is needed for mrmrm state-change range_fire = TRUE; |
From: Rob <geo...@us...> - 2006-01-29 16:13:20
|
Update of /cvsroot/timewarp/source/ppiships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12385/ppiships Log Message: Directory /cvsroot/timewarp/source/ppiships added to the repository |
From: Paul F. <you...@us...> - 2005-12-29 20:54:57
|
Update of /cvsroot/timewarp/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28469 Added Files: robots.txt Log Message: Adding site/robots.txt . This is to rank higher on search engines such as google. Previously, our robots.txt file was pretty restrictive. --- NEW FILE: robots.txt --- #Updated 2005.12.27 yB! User-agent: * Allow: / Disallow: /temp Disallow: /downloads Disallow: /installers Disallow: /forum/config.php Disallow: /forum/modcp.php Disallow: /forum/posting.php Disallow: /forum/privmsg.php Disallow: /forum/rss.php Disallow: /forum/rss_body.tpl Disallow: /forum/admin Disallow: /forum/cache Disallow: /forum/db Disallow: /forum/images |
From: Rob <geo...@us...> - 2005-10-05 20:24:58
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv548/source/melee Modified Files: mgame.cpp mshot.cpp Log Message: don't remember, I think only changes due to bug-hunting, but no real changes to the game. Index: mshot.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshot.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mshot.cpp 23 Aug 2005 22:21:16 -0000 1.21 --- mshot.cpp 5 Oct 2005 20:24:49 -0000 1.22 *************** *** 146,149 **** --- 146,154 ---- SpaceLocation::scale_vel(scale); v *= scale; + + if (v < 0.01) + v = 0.01; + // prevent negative velocities! + range = d + (range - d) * scale; // the remaining distance should also be scaled, otherwise it could live forever. Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** mgame.cpp 22 Sep 2005 07:24:31 -0000 1.58 --- mgame.cpp 5 Oct 2005 20:24:49 -0000 1.59 *************** *** 230,234 **** if (!melee) tw_error("Error loading melee data\n"); ! meleedata.panelSprite = new SpaceSprite(&melee[MELEE_PANEL], PANEL_FRAMES, SpaceSprite::IRREGULAR); meleedata.kaboomSprite = new SpaceSprite(&melee[MELEE_KABOOM], KABOOM_FRAMES, SpaceSprite::ALPHA | SpaceSprite::MASKED);// | SpaceSprite::MIPMAPED); --- 230,234 ---- if (!melee) tw_error("Error loading melee data\n"); ! meleedata.panelSprite = new SpaceSprite(&melee[MELEE_PANEL], PANEL_FRAMES, SpaceSprite::IRREGULAR | SpaceSprite::MATCH_SCREEN_FORMAT); meleedata.kaboomSprite = new SpaceSprite(&melee[MELEE_KABOOM], KABOOM_FRAMES, SpaceSprite::ALPHA | SpaceSprite::MASKED);// | SpaceSprite::MIPMAPED); |
From: Rob <geo...@us...> - 2005-10-05 20:24:03
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv355/source/melee Modified Files: mship.cpp mship.h Log Message: added a routine to copy ship-data from another ship Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** mship.cpp 3 Sep 2005 19:49:45 -0000 1.44 --- mship.cpp 5 Oct 2005 20:23:55 -0000 1.45 *************** *** 1343,1344 **** --- 1343,1370 ---- return (Presence::exists());// & (death_counter == -1); }; //returns 0 if dead, non-zero if alive + + + + + void Ship::copy_values(Ship *owner) + { + mass = owner->mass; + + crew = owner->crew; + crew_max = owner->crew_max; + batt = owner->batt; + batt_max = owner->batt_max; + + recharge_rate = owner->recharge_rate; + recharge_step = recharge_rate; + recharge_amount = owner->recharge_amount; + + turn_rate = owner->turn_rate; + accel_rate = owner->accel_rate; + speed_max = owner->speed_max; + + damage_factor = 0; + isblockingweapons = owner->isblockingweapons; + } + + Index: mship.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** mship.h 23 Aug 2005 22:21:16 -0000 1.25 --- mship.h 5 Oct 2005 20:23:55 -0000 1.26 *************** *** 171,174 **** --- 171,175 ---- virtual ~Ship(); virtual void death(); + void copy_values(Ship *owner); |
From: Rob <geo...@us...> - 2005-10-05 20:23:09
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32687/source/melee Modified Files: msprite.cpp Log Message: an incomplete if-statement fix, which resulted in no graphics loaded in some cases... (my sloppiness after a code-rewrite). Index: msprite.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/msprite.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** msprite.cpp 27 Sep 2005 22:03:55 -0000 1.28 --- msprite.cpp 5 Oct 2005 20:23:00 -0000 1.29 *************** *** 620,628 **** --- 620,636 ---- draw_rle_sprite(tmp, (RLE_SPRITE *)(images[i].dat), 0, 0); + /* if (general_attributes & ALPHA) handle_alpha_load(tmp); + // go from tmp to bmp if (obpp != bpp) convert_bitmap(tmp, bmp, (general_attributes & MASKED) ? AA_MASKED : 0); + else + blit(tmp, bmp, 0, 0, 0, 0, bw, bh); + */ + + //xxx test + blit(tmp, bmp, 0, 0, 0, 0, bw, bh); destroy_bitmap(tmp); *************** *** 1019,1023 **** frame->add_box(ix, iy, iw, ih); - return; } --- 1027,1030 ---- |