DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Upgradable weapon
Page 1 of 1
DieHard Wolfers Forum Index -> Feature Fanatics View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
wolfwhips
DieHard Officer
DieHard Officer


Joined: 09 Aug 2006
Last Visit: 28 Oct 2016

Topics: 66
Posts: 546

newzealand.gif

PostPosted: Tue Sep 05, 2006 1:44 pm
   Subject: Upgradable weapon
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Hi again, for my mod I wanted to include a special end boss fight, not the usual one where you have to fire at the boss, run for cover, and fire again. I would like it so that only a weapon is capable of defeating the boss, but that the weapon can only do so after picking up an object that "upgrades" the weapon. Where in the code would I make changes for that?
Lozer_42
DieHard Wolfer
DieHard Wolfer


Joined: 09 Jun 2006
Last Visit: 2:26 ago.

Topics: 49
Posts: 1162
Location: Grand Rapids, Michigan
usa.gif

PostPosted: Tue Sep 19, 2006 11:11 am
   Subject: Re: Upgradable weapon
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

do you mean like how there are 2 kinds of shotguns in doom? or nothing like that...

_________________
Team RayCast YouTube Let's Play Commentaries
View Team RayCast on Mod DB
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 17 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Tue Sep 19, 2006 11:29 am
   Subject: Re: Upgradable weapon
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Hmm... Didn't someone already send a code for this?

Well, anyway. First define a new bo_ .
Add this to end of the WL_Def.H:

::: CODE :::

int upgrade;


Then in WL_Agent.C:

::: CODE :::


case bo_upgrade:
       
    upgarede++;
    SD_PlaySound(YourSoundHere);
    GetMessage("Weapon x upgraded..."); // Incase you use WSJs ingame messages, x is
                                                            // the weapon to upgrade
break;



Then still in the WL_Agent.C go down to "GunAttack"
and you should see something like this:

::: CODE :::

//
// hit something
//
   dx = abs(closest->tilex - player->tilex);
   dy = abs(closest->tiley - player->tiley);
   dist = dx>dy ? dx:dy;

   if (dist<2)
      damage = US_RndT() / 4;
   else if (dist<4)
      damage = US_RndT() / 6;
   else
   {
      if ( (US_RndT() / 12) < dist)      // missed
         return;
      damage = US_RndT() / 6;
   }

   DamageActor (closest,damage);


Changge it to something like this:

::: CODE :::

//
// hit something
//
   dx = abs(closest->tilex - player->tilex);
   dy = abs(closest->tiley - player->tiley);
   dist = dx>dy ? dx:dy;

   if (dist<2)
      damage = US_RndT() / 4;
   else if (dist<4)
      damage = US_RndT() / 6;
   else
   {
      if ( (US_RndT() / 12) < dist)      // missed
         return;
      damage = US_RndT() / 6;
   }
   switch(gamestate.weapon)
   {               
       case wp_chaingun: // Now the chaingun is "upgradable"
            switch(upgrade)
                         {
                             case 1: damage = damage*0,50; break;
                             case 2: damage = damage*1,00; break;
                             case 3: damage = damage*1,50; break; // add as many cases as you need;
                             default: damage = damage;                   // no upgrades... though this migh cause
                                                                                        // problems                                     
                         }
       break;

                   default: damage=damage; break;
   }

   DamageActor (closest,damage);
}


Though I am not 100% sure will this work... But hopefully you get the idea.
Oh, this is based on the BrotherTanks weapon effectivity tutorial..

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Feature Fanatics View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts "Awesomest Weapon" contest
Author: Dugtrio17
13 2719 Mon Aug 20, 2007 6:08 pm
Anonymous View latest post
No new posts fire extinguisher weapon
Author: wolfwhips
3 1012 Mon Nov 20, 2006 9:45 am
wolfwhips View latest post
No new posts forcefield enabled by boss armor
Author: wolfwhips
7 1083 Tue Sep 05, 2006 1:40 pm
wolfwhips View latest post
No new posts new weapon
Author: wolfwhips
3 822 Mon Sep 04, 2006 8:18 pm
Tricob View latest post
No new posts Zooming scope for weapon
Author: Lozer_42
0 532 Sun Sep 03, 2006 12:40 pm
Lozer_42 View latest post
 
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


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group