Drain Vore code (Done... probably)

Screw up game balance and fix bugs by creating more bugs. Now you too can join the discussion. This is where the magic happens. Sometimes actual magic.

Regarding the weight system and draining...

Poll ended at Wed Apr 13, 2016 8:05 pm

Draining should drain nutrients and nutrients alone, leave weight unaffected.
0
No votes
Draining should drain both nutrients and weight at the same time.
0
No votes
Draining should drain nutrients first, then weight.
3
60%
Draining nutrients and draining weight should be their own, seperate modes.
2
40%
Other (Please post what you think).
0
No votes
 
Total votes : 5

Drain Vore code (Done... probably)

Postby Daisy » Sat Apr 02, 2016 11:38 pm

A small little change to the stomach and belly file I made. It ran fine, I was able to absorb nutrients from my prey, as well as switching to digestion and digesting said prey without a problem. It wasn't a really big problem, I just added a few lines from the womb file and added it to the stomach, as well as fiddling with belly.dm, though I'm not sure if that last part was necessary, but I did it just in case.

I took a bit of code from the files and only showed the bits along with the surrounding code to show what I did and the location.

belly_stomach.dm
Code: Select all
//   Implementation of Oral Vore by the "Stomach" belly type.
//   Note: This also handles Anal Vore.   Possibly consider more differentiation.
// 

/datum/belly/stomach
   belly_type = "Stomach"
   belly_name = "stomach"
   inside_flavor = "There is nothing interesting about this stomach."

// @Override
/datum/belly/stomach/get_examine_msg(t_He, t_his, t_him, t_has, t_is)
   if (internal_contents.len)
      return "[t_He] [t_has] something solid in [t_his] stomach!\n"

/datum/belly/stomach/toggle_digestion()
   digest_mode = input("Stomach Mode") in list("Hold", "Drain", "Digest")
   switch (digest_mode)
      if("Drain")
         owner << "<span class='notice'>You will now drain nutrition from people in your stomach.</span>"
      if("Digest")
         owner << "<span class='notice'>You will now digest people in your stomach.</span>"
      if("Hold")
         owner << "<span class='notice'>You will now harmlessly hold people in your stomach.</span>"

// @Override

// @Override
/datum/belly/stomach/process_Life()
   for (var/mob/living/M in internal_contents)
   
            //STOMACH DRAIN
      if(iscarbon(M) && owner.stat != DEAD && digest_mode == "Drain" && M.stat != DEAD))
         if(air_master.current_cycle%3==1)
            if(!(M.status_flags & GODMODE))
               if(M.nutrition > 90)
                  owner.nutrition += 10            // I took it from the womb code because I'm SOOOO clever... Edit the values and the code to your heart's content. -Daisy
                  M.nutrition -= 10
               else if (M.nutrition <= 90)
                  if (M.weakened == 0)                  // If they were weakened before and they're that hungry, both of you are probably not going to notice a difference.
                     owner << "<span class='notice'>You feel [M]'s struggles dying down as their body is drained almost completely to the point of exaustion.</span>"   //Pred's message.
                     M << "<span class='notice'>Your body feels too weak to offer any significant resistance inside of [owner]'s stomach.</span>"   //Prey's message.
                     M.Weaken(10)
                  else
                     M.Weaken(10)                  // Knocked down, but still able to talk and emote clearly.Keeps resetting to 10 until free.
                  if (M.weight > 70.05)                  // Turn fat into nutrition!
                     M.weight -= 0.05
                     owner.nutrition += 1            // I have no idea how much 1 unit of weight is worth in terms of nutrition
                  else if (M.weight < 70)
                     M.weight = 70                  // Prevent it from accidentally going lower



Anyway, I hope the code is good enough, and I'd love for it to be added to the game so preds can get their nutrients without having to digest.

Edit: Based on this request: https://github.com/SpadesNeil/VOREstation/issues/273
Edit2: Updated this post's code with what I have recently.
Edit3: Started a poll regarding the weight system we have now.
Edit4: I cut corners, editing belly.dm was unnecessary, so I altered the stomach code a bit and removed the belly.dm code.
Edit5: Here is the file. Make sure to save and replace the old one. Looking over, this whole code may end up getting overshadowed by absorption, but dang it, it is here just in case. Also, I updated the stomach code on the front page to include weight draining.
Attachments
Draining.zip
Remember to put the file inside the zip inside of the belly folder and replace the file, located in \code\modules\vore\... and maybe save the old file in case something goes horribly wrong. Anyway, enjoy!
(3.25 KiB) Downloaded 551 times
Last edited by Daisy on Thu Apr 14, 2016 1:23 pm, edited 10 times in total.
Daisy
 
Posts: 22
Joined: Sat Apr 02, 2016 11:05 pm

Re: Drain Vore code

Postby Scree » Sun Apr 03, 2016 1:20 am

Oooh, nice. I see that it bypasses the check for whether the prey has toggled themselves digestible or not, but I'm one of the most endoey people on the server as prey and I don't have a problem with that. Saves having to toggle myself back to "digestible" so they can set their mode.

That and it's far far far less of an issue than accidentally leaving digestion on was before we had he prey-side toggle. Looks good!

Any plans for doing something when the prey run low, or just leave them at 90? The simplest thing that comes to mind would be forcing them to rest while they're still in a draining stomach and don't have much nutrient left - they'll still be able to emote and talk and so on but won't be able to do anything.
User avatar
Scree
 
Posts: 1002
Joined: Thu Aug 06, 2015 3:57 pm

Re: Drain Vore code

Postby Daisy » Sun Apr 03, 2016 1:33 am

Well, it's just a simple add-in for now. I'm not really a good programmer, but I guess if someone were to modify it, they could put that stuff in. I don't know how to make it stun people at a certain point, unless I continue to dig in deeper into the game's code. As for the indigestible thing skipping the process, I guess that could be added if it becomes a problem.

If, or when I do find out how to stun someone, it'll happen once they hit or dip below 90.
Daisy
 
Posts: 22
Joined: Sat Apr 02, 2016 11:05 pm

Re: Drain Vore code

Postby Scree » Sun Apr 03, 2016 3:11 am

Actually, it's a good thing that it bypasses the indigestible check. If someone leave their belly on drain mode and someone doesn't want that, it's something that can be easily remedied by LOOC and a donk pocket, unlike actual damage - and it means endo prey don't have to turn digestible on to play draining scenes.
User avatar
Scree
 
Posts: 1002
Joined: Thu Aug 06, 2015 3:57 pm

Re: Drain Vore code

Postby Daisy » Sun Apr 03, 2016 12:08 pm

There, with a bit of tinkering, I made it so people are weakened inside once they hit or fall below the nutrition threshold.

belly_stomach.dm
Code: Select all
/datum/belly/stomach/toggle_digestion()
   digest_mode = input("Stomach Mode") in list("Hold", "Drain", "Digest")
   switch (digest_mode)
      if("Drain")
         owner << "<span class='notice'>You will now drain nutrition from people in your stomach.</span>"
      if("Digest")
         owner << "<span class='notice'>You will now digest people in your stomach.</span>"
      if("Hold")
         owner << "<span class='notice'>You will now harmlessly hold people in your stomach.</span>"

// @Override

// @Override
/datum/belly/stomach/process_Life()
   for (var/mob/living/M in internal_contents)

      //STOMACH DRAIN
      if(iscarbon(M) && owner.stat != DEAD && digest_mode == DM_DRAIN && M.stat != DEAD)
         if(air_master.current_cycle%3==1)
            if(!(M.status_flags & GODMODE))
               if(M.nutrition > 90)
                  owner.nutrition += 3            // I took it from the womb code because I'm SOOOO clever... Edit the values and the code to your heart's content. -Daisy
                  M.nutrition -= 3
               else if (M.nutrition <= 90)
                  M.Weaken(10)                  // Knocked down, but still able to talk and emote clearly.Keeps resetting to 10 until free.
                  
      //STOMACH DIGEST
      if(iscarbon(M) && owner.stat != DEAD && digest_mode == DM_DIGEST)
         if(istype(M, /mob/living/carbon/human))
            var/mob/living/carbon/human/R = M
            if(R.digestable == 0)
               continue
Daisy
 
Posts: 22
Joined: Sat Apr 02, 2016 11:05 pm

Re: Drain Vore code

Postby rikaru19 » Sun Apr 03, 2016 1:03 pm

So hoping this gets implemented next update. A vore mode that gives nutrition without digestion or pain? Reika would support the heck outta this.
User avatar
rikaru19
 
Posts: 141
Joined: Sun Feb 14, 2016 4:18 pm

Re: Drain Vore code

Postby Daisy » Sun Apr 03, 2016 1:30 pm

With this code, I hope maybe vore will be a lot more common around the station, since with this code people can now feed off their coworkers, and keep them too... and a good way to lose/gain fat!
Daisy
 
Posts: 22
Joined: Sat Apr 02, 2016 11:05 pm

Re: Drain Vore code

Postby rikaru19 » Sun Apr 03, 2016 3:27 pm

Only issue with me is figuring out how to ICly explain it if Reika starts using this method...
User avatar
rikaru19
 
Posts: 141
Joined: Sun Feb 14, 2016 4:18 pm

Re: Drain Vore code

Postby Scree » Sun Apr 03, 2016 6:02 pm

As long as weakening them doesn't spam the message box.
User avatar
Scree
 
Posts: 1002
Joined: Thu Aug 06, 2015 3:57 pm

Re: Drain Vore code

Postby Wickedtemp » Sun Apr 03, 2016 6:15 pm

I like this. I like this a lot.

As a pred, I don't do digestion at all. And as for my prey character, I'm indifferent.

So yeah, this would be excellent! It's awesome :3
User avatar
Wickedtemp
 
Posts: 392
Joined: Mon Nov 23, 2015 3:35 am

Next

Return to Coding

Who is online

Users browsing this forum: No registered users and 8 guests