# HG changeset patch # User unc0rr # Date 1239549848 0 # Node ID 31e449e1d9dd63ccbfde81462a5f4d76a06f4792 # Parent 340bfd438ca507c23db1e602b87a80b1b7d13a53 nemo's patch + ropes ammo scheme hack diff -r 340bfd438ca5 -r 31e449e1d9dd QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Sun Apr 12 12:51:25 2009 +0000 +++ b/QTfrontend/hwconsts.cpp.in Sun Apr 12 15:24:08 2009 +0000 @@ -29,7 +29,7 @@ QStringList * Themes; QStringList * mapList; -QString * cDefaultAmmoStore = new QString("939192942219912103223511100120111111"); +QString * cDefaultAmmoStore = new QString("939192942219912103223511100120100000"); QColor * color1 = new QColor(221, 0, 0); QColor * color2 = new QColor( 67, 118, 233); diff -r 340bfd438ca5 -r 31e449e1d9dd hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sun Apr 12 12:51:25 2009 +0000 +++ b/hedgewars/uAmmos.pas Sun Apr 12 15:24:08 2009 +0000 @@ -33,6 +33,8 @@ procedure SetWeapon(weap: TAmmoType); procedure DisableSomeWeapons; +var shoppa: Boolean = false; + implementation uses uMisc, uGears, uWorld, uLocale, uConsole; type TAmmoCounts = array[TAmmoType] of Longword; @@ -62,6 +64,9 @@ begin TryDo(byte(s[0]) = byte(ord(High(TAmmoType)) + 1), 'Invalid ammo scheme (incompatible frontend)', true); +// TEMPORARY hardcoded check on shoppa pending creation of probability editor +if (s = '000000990000009000000000000000000000') or (s = '000000990000000000000000000000000000') then + shoppa:= true; inc(StoreCnt); TryDo(StoreCnt <= cMaxHHs, 'Ammo stores overflow', true); @@ -81,7 +86,10 @@ begin cnt:= 0; Ammoz[a].Probability:= 0 - end; + end + else if shoppa then // TEMPORARY REMOVE WHEN CRATE PROBABILITY IS ADDED + if not cnt = AMMO_INFINITE then + Ammoz[a].Probability:= 100; ammos[a]:= cnt end; diff -r 340bfd438ca5 -r 31e449e1d9dd hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Sun Apr 12 12:51:25 2009 +0000 +++ b/hedgewars/uCollisions.pas Sun Apr 12 15:24:08 2009 +0000 @@ -118,7 +118,7 @@ IntersectGear:= nil; TestWord:= 0 end else - TestWord:= COLOR_LAND - 1 + TestWord:= 255 else TestWord:= 0; x:= hwRound(Gear^.X); @@ -149,7 +149,7 @@ IntersectGear:= nil; TestWord:= 0 end else - TestWord:= COLOR_LAND - 1 + TestWord:= 255 else TestWord:= 0; y:= hwRound(Gear^.Y); @@ -182,7 +182,7 @@ i:= y + Gear^.Radius * 2 - 2; repeat if (y and LAND_HEIGHT_MASK) = 0 then - if Land[y, x] = COLOR_LAND then exit(true) + if Land[y, x] > 255 then exit(true) else if Land[y, x] <> 0 then flag:= true; inc(y) until (y > i); @@ -233,7 +233,7 @@ repeat if (x and LAND_WIDTH_MASK) = 0 then if Land[y, x] > 0 then - if Land[y, x] = COLOR_LAND then exit(true) + if Land[y, x] > 255 then exit(true) else if Land[y, x] <> 0 then flag:= true; inc(x) until (x > i); @@ -291,7 +291,7 @@ i:= x + Gear^.Radius * 2 - 2; repeat if (x and LAND_WIDTH_MASK) = 0 then - if Land[y, x] = COLOR_LAND then exit(true); + if Land[y, x] > 255 then exit(true); inc(x) until (x > i); end; diff -r 340bfd438ca5 -r 31e449e1d9dd hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Apr 12 12:51:25 2009 +0000 +++ b/hedgewars/uGears.pas Sun Apr 12 15:24:08 2009 +0000 @@ -1638,7 +1638,14 @@ FollowGear:= nil; -case getrandom(20) of +t:= getrandom(20); // TEMPORARY REMOVE WHEN CRATE PROBABILITY IS ADDED +if shoppa then + t:= 7 +else + t:= getrandom(20); + +//case getrandom(20) of +case t of 0..6: begin FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0); FollowGear^.Health:= 25;