FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CODE: Wanted bandits {In Progress}

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Tue Dec 25, 2012 9:14 am    Post subject: CODE: Wanted bandits {In Progress} Reply with quote

This is still under construction as it's one of the first updates I had in mind ever since tinywarz became OS.

The basic idea is 'wanted' bandits spawn on konu (or any other planets). Some are tough, others are lulzy and reward of killing them should depend on that.

These bandits will be buffed:
- Shak AI
- 2x Shields
- 3x Recharge
- 2x Armor
- Max speed +2
- Controlled speed = Max speed (after adding 2)
- All ballistic weapons become range 10, 2x damage + 5, Mag effect
- All energy weapons become range 5,2x damage + 10, 1 recharge, EMP effect
- All missile weapons become range 5,2x damage, AArm effect
- Immunity to commands
- Reveals cloakers every other turn
- Repairs 25 armor every turn
- 10x CE for experience
- A new weapon type that has range 15, never misses, doesn't cause damage, and appears in events as if a command was issued giving an illusion that the said unit has issued a command

Wanted bandit list so far:
- Ghog
- Wolfhound
- Ares
- Ballista
- Gatlinger
- Hellbore
- Juggernaugt
- Light foot meka
- Super Nova
- Paladin
- Night stalker

To do list for this update:
- Should default weapon types be over written by the new ones?
- New units for the wanted list?
- At the moment they are not salvageable (to prevent necro trolling), what should be the reward? new achievements? 1 tbs per wanted kill? The reward should be high to encourage dropping but not high enough to make it a rare spawn. The exp on it's own should be an incentive.
- Spawn rate? I am thinking 1% per turn on konu. It spawns randomly and can never be spawned by a player. Can spawn right in the middle of your base
- They spawn on their own. Only one this isn't swarm. You can fight this with 1 unit (very challenging) or have a little assasin squad.
- What are the commands that can be issued?


Code so far

Code:
function add_wanted($x,$y,$sector,$quad)
{   
   /* By khaibar:
      Inserts boosted bandits into the game. The 'wanted' bandits would have extra damage,range,weapon effects,immunity to commands as well as the ability to 'issue commands'.
      These won't be unbeatable or Shak like or Swarm like. They will be simply tough and spawn on their own.
   */
   
   // Global stuff
   global $allunits,$planetid;
   
   // Ares: 44 , Ballista: 29, Gat: 52, Ghog: 8,Hellbore: 37,Jug: 28,LF: 60,Supernova: 14,Wolf: 51,Paladin: 26,NS: 81
   $wanted_unit=Array(44,44,29,29,52,8,8,8,8,8,8,8,37,28,60,60,14,14,51,51,51,51,51,51,26,26,81);
   $wanted_unit=$wanted_unit[array_rand($wanted_unit)]; // Get random id from array
   
   // Setting the AI
   $wanted_AI["TYPE"]["VALUE"] = "Sha"; // Give it shak AI
   $wanted_AI["RANGE"]["VALUE"] = 10; // Default range to prevent mishaps
   if(($wanted_unit==44)||($wanted_unit==37)||($wanted_unit==60)||($wanted_unit==14)||($wanted_unit==51)||($wanted_unit==26)||($wanted_unit==28))
   $wanted_AI["RANGE"]["VALUE"] = 3; // unit has energy gun
   else $wanted_AI["RANGE"]["VALUE"] = 10; // unit is either missile or ballistic, stay as far away as possible
   $wanted_id=addUnit($wanted_unit,'unit',$x,$y,$sector,$quad,5,$wanted_AI,1,'N',Array()); // Crew id is 5 (bandit crew id?) and owner is 1 (bandits?)
   
   // Boosting the health, 2x shields, 3x recharge, 2x armor
   $sql  = "UPDATE deployed_units SET  i_shields = 2*i_shields,i_shields_max = 2*i_shields_max, i_shields_regen = 3*i_shields_regen,i_armor_max=2*i_armor_max,i_armor=2*i_armor WHERE  id=?";
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
               
   // Increasing it's CE (more experience, a lot more experience)
   $sql  = "UPDATE deployed_units SET  i_ce = 10*i_ce WHERE  id=?";
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
   
   // Boosting the speed, + 2 max speed controlled=max
   $sql  = "UPDATE deployed_units SET  i_speed_full = i_speed_full+2,i_speed_half=i_speed_full WHERE  id=?";
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
   
   // Boosting the guns
   $sql  = "UPDATE deployed_weapons SET  mod_type='Mag',i_range = 10, i_damage = 2*i_damage+5 WHERE c_type='B' AND i_on_unit=?"; // Boost ballistic guns and make them Mag
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
   $sql  = "UPDATE deployed_weapons SET  mod_type='EMP',i_range = 5, i_damage = 2*i_damage+10,i_recharge=1,i_charge=1 WHERE c_type='E' AND i_on_unit=?"; // Boost energy guns and make them EMP
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
   $sql  = "UPDATE deployed_weapons SET  mod_type='AArm',i_range = 5, i_damage = 2*i_damage WHERE c_type='M' AND i_on_unit=?"; // Boost missile guns and make them AArm
   $res =& $db->query($sql, $wanted_id);
   if (DB::isError($res)) { ReportDBError($res); }
   
   // Adding the effects, just 3 for now
   $sqltext ="INSERT INTO deployed_effects (i_actor, i_target,c_type, i_amount, i_owner, has_duration, i_planet)VALUES (".$wanted_id.",".$wanted_id.",'nocom',0,1,'N',".$planetid.")";
    $res =& $db->query($sqltext, Array() ); // Immunity to commands
   if (DB::isError($res)) { ReportDBError($res, "process_turn"); }
   $sqltext ="INSERT INTO deployed_effects (i_actor, i_target,c_type, i_amount, i_owner, has_duration, i_planet)VALUES (".$wanted_id.",".$wanted_id.",'rvclk',2,1,'N',".$planetid.")";
    $res =& $db->query($sqltext, Array() ); // Reveals cloakers every other turn
   if (DB::isError($res)) { ReportDBError($res, "process_turn"); }
   $sqltext ="INSERT INTO deployed_effects (i_actor, i_target,c_type, i_amount, i_owner, has_duration, i_planet)VALUES (".$wanted_id.",".$wanted_id.",'armor',25,1,'N',".$planetid.")";
    $res =& $db->query($sqltext, Array() ); // Repairs 25 armor every turn
   if (DB::isError($res)) { ReportDBError($res, "process_turn"); }

   // Tag unit as wanted with an effect
   $sqltext ="INSERT INTO deployed_effects (i_actor, i_target,c_type, i_amount, i_owner, has_duration, i_planet)VALUES (".$wanted_id.",".$wanted_id.",'WANTED',0,1,'N',".$planetid.")";
    $res =& $db->query($sqltext, Array() ); // Repairs 25 armor every turn
   if (DB::isError($res)) { ReportDBError($res, "process_turn"); }
   
   /* Adding the gun that let's issuing commands possible (This gun will never miss, always does zero damage and will not appear in events as a weapon but as [wanted unit] issued [insert command name] on [insert target] giving an illusion of an issued command) */
   $sql ="INSERT INTO deployed_weapons (c_type,i_range,i_damage,i_ammo,i_ammo_max,i_recharge,i_charge,mod_type,i_on_unit) VALUES ('B',15,0,100,100,-1,-1,'COMMAND',".$wanted_id.")";
   $res =& $db->query($sql, Array());
   if (DB::isError($res)) { ReportDBError($res); }
   
   // Let everyone know
   if (!isset($allunits)) { $allunits = getxmldata("units"); }
   $sql  = "INSERT INTO users_chat (s_message,user_id,chat_to) VALUES ('Wanted ".$allunits["UNITS"]["UNIT"][$wanted_id]["NAME"]." spotted on Konu!',15,'all')";
   $res =& $db->query($sql, Array() );
   if (DB::isError($res)) { ReportDBError($res); }
      
return $wanted_id;         
}


Please feel free to participate in codes, ideas etc...
I will not make a ticket regarding this nor push it by git till we agree on the full details and council approves.
Back to top
View user's profile Send private message
haloguy48
Advanced


Joined: 12 Jul 2006
Posts: 1221
Location: Looking for Group archives

PostPosted: Sat Dec 29, 2012 8:03 am    Post subject: Reply with quote

im sorta evil, add Pirata to the list? Or even all cmmdr units to list, would be interesting to see an SSM... Oh gosh a Dreadnaught would be a community event O_o .... I love the idea as well. Would the 1% be per turn? meaning it could easily spawn once every two-three cycles....

As for commands... -2 max/controlled speed next turn , -25% shields, +3dmg per hit, no shield regen this turn... Sounds all fun and... Hard. Which is the fun part!

Edit:

New achievements for sure!

Reward..? Maybe tie that in with Achievements..
_________________
Check out my Created Construx, all feedback welcomed! I'll start you out on the newer stuff, so just scroll down! Razz
http://forum.mobrulestudios.com/viewtopic.php?p=149822#149822
Back to top
View user's profile Send private message
tomohawk
Advanced


Joined: 26 Sep 2009
Posts: 522
Location: Behind you!

PostPosted: Wed May 01, 2013 9:11 am    Post subject: Reply with quote

+++++++
I don't know if the code is good. However bandit bosses would be awesome.
_________________
^this guy is crazy^
The Beatings Will Continue Until Morale Improves

Death before dishonor.

*not funny*
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed May 01, 2013 9:14 am    Post subject: Reply with quote

it should be good, I never got to add the COMMAND weapon effect checks though
Back to top
View user's profile Send private message
Germán
Intermediate


Joined: 18 Jul 2008
Posts: 257
Location: Rosario - Santa Fe - Argentina

PostPosted: Tue Jun 18, 2013 12:19 pm    Post subject: Reply with quote

what if they have some sort of experience, every when a bandit kills a plyers unit, it gives more experience, if they are some kind of boss, could UD, and next time it spawns,/deploy have in consideration the kills it made.
Back to top
View user's profile Send private message MSN Messenger
ItsNick
Intermediate


Joined: 23 Dec 2008
Posts: 357
Location: India

PostPosted: Sat Oct 12, 2013 4:45 am    Post subject: Reply with quote

nice
_________________
Signed Sealed and Delivered.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Sat Oct 12, 2013 5:38 pm    Post subject: Reply with quote

Definitely support implementing on Konu. Depending on the experience there, could expand to other planets (with accompanying tweets).
Back to top
View user's profile Send private message
Aznboi01
Advanced


Joined: 08 Jun 2007
Posts: 601
Location: Akasla,ASU

PostPosted: Sun Jan 12, 2014 3:36 am    Post subject: Reply with quote

This should really apply to rynn
_________________
In Game Name: ExSoldier
Back to top
View user's profile Send private message
haloguy48
Advanced


Joined: 12 Jul 2006
Posts: 1221
Location: Looking for Group archives

PostPosted: Sun Mar 02, 2014 2:23 am    Post subject: Reply with quote

Was this ever completed?

I support this!

HG48
_________________
Check out my Created Construx, all feedback welcomed! I'll start you out on the newer stuff, so just scroll down! Razz
http://forum.mobrulestudios.com/viewtopic.php?p=149822#149822
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sun Mar 02, 2014 4:08 am    Post subject: Reply with quote

Nope, the little things aren't getting through. Something like this is easy to implement but may require an extra field in the database (is_wanted). This is pretty much the same as bandit bosses. It can be done but it requires a new field in the database and a new background color to show that it's a special bandit. but like i said no reason to go through all of this (or anything similar) unless the gears of OS start moving.
Back to top
View user's profile Send private message
tomohawk
Advanced


Joined: 26 Sep 2009
Posts: 522
Location: Behind you!

PostPosted: Tue Dec 01, 2015 2:20 pm    Post subject: Reply with quote

Very Happy Smile Sad Surprised Shocked Confused Cool Laughing Mad Razz Embarassed Crying or Very sad Evil or Very Mad Twisted Evil Rolling Eyes Wink Exclamation Question Idea Arrow Neutral Mr. Green
_________________
^this guy is crazy^
The Beatings Will Continue Until Morale Improves

Death before dishonor.

*not funny*
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group