Author Topic: Some of the basic concepts and variables in Crazy's Mod  (Read 51382 times)

0 Members and 1 Guest are viewing this topic.

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #15 on: April 29, 2015, 07:56:24 PM »
Is someone updating the jobs to support tips? If not I'll do it.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Accommodation, House Percent and other Variables.
« Reply #16 on: April 30, 2015, 12:03:42 AM »
Is someone updating the jobs to support tips? If not I'll do it.
Have at it.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #17 on: April 30, 2015, 05:56:41 AM »
Have at it.
Sleazy Waitress is done. I've added a modifier to tips that is pretty much a copy of something crazy wrote for the regular barmaid job. I hope it works fine.

Offline crazy

  • Hero Member
  • *****
  • Posts: 733
Re: Accommodation, House Percent and other Variables.
« Reply #18 on: May 01, 2015, 03:43:34 AM »
Sleazy Waitress is done. I've added a modifier to tips that is pretty much a copy of something crazy wrote for the regular barmaid job. I hope it works fine.
Looks fine to me.  Even fixed spelling errors so all the better lol
« Last Edit: May 01, 2015, 04:34:48 AM by crazy »

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #19 on: May 01, 2015, 06:34:49 AM »
Barmaid and Bar Waitress done.

I found in the nurse job that lesbian nurses get turned on by half the patients (by looking at naked women, I guess). I was thinking about doing something similar for the non-straight barmaid and waitresses that work in the strip club (they spend hours surrounded by half naked sexy women):
Quote from: code
    if (!g_Girls.HasTrait(girl, "Straight"))    { libido += min(3, g_Brothels.GetNumGirlsOnJob(0, JOB_BARSTRIPPER, false); }
Add it?

I had a lactation scene almost finished for Sleazy Barmaid but crazy wrote a similar one for the barmaid job already. Go for it anyway?

So far I've used 10-20% base wages for tips in maid and waitress jobs. Strippers should earn way more and I'm thinking about 5-40%. Should be even more? less?

Offline crazy

  • Hero Member
  • *****
  • Posts: 733
Re: Accommodation, House Percent and other Variables.
« Reply #20 on: May 01, 2015, 08:52:30 PM »
I found in the nurse job that lesbian nurses get turned on by half the patients (by looking at naked women, I guess). I was thinking about doing something similar for the non-straight barmaid and waitresses that work in the strip club (they spend hours surrounded by half naked sexy women):Add it?
Yeah sure add it
I had a lactation scene almost finished for Sleazy Barmaid but crazy wrote a similar one for the barmaid job already. Go for it anyway?
As long as it is different then sure add it
So far I've used 10-20% base wages for tips in maid and waitress jobs. Strippers should earn way more and I'm thinking about 5-40%. Should be even more? less?
Sound about right.. add it how you think and we can adjust it later if we need to.  Jobs pay is way off right now anyway

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #21 on: May 02, 2015, 06:30:50 AM »
Sound about right.. add it how you think and we can adjust it later if we need to.  Jobs pay is way off right now anyway
Ok.

As long as it is different then sure add it
I'll see if I can make it more different to add it later.

All the barmaid, waitress and strippers jobs done and more.

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #22 on: May 04, 2015, 06:15:15 AM »
Dealer, Entertainer, Singer and Pianist done. Added a small thing for Idol Singers. Are there other jobs that need to be updated?

Offline crazy

  • Hero Member
  • *****
  • Posts: 733
Re: Accommodation, House Percent and other Variables.
« Reply #23 on: May 06, 2015, 07:43:27 PM »
Dealer, Entertainer, Singer and Pianist done. Added a small thing for Idol Singers. Are there other jobs that need to be updated?
Sorry for late replay been busy kinda slipped my mind.  I think you got them all.  But if you want keep going over the jobs fixing the spelling and stuff is a great help as Im awful at that.  Feel free to add more events to.  Mod can always use help.

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #24 on: May 09, 2015, 06:46:17 AM »
Sorry for late replay been busy kinda slipped my mind.  I think you got them all.  But if you want keep going over the jobs fixing the spelling and stuff is a great help as Im awful at that.  Feel free to add more events to.  Mod can always use help.
I'll see what I can do. I have some event ideas but they need some work.

While looking at the jobs I saw several sex events for nymphos, I was thinking if succubus should be able to trigger them too.

There was a small mistake in the Sleazy Waitress job (nothing that can crash the game) and I posted a fix in the bug thread, I'm not sure if you've seen it.

EDIT - I missed the masseuse job. I'll upload both later.

EDIT 2 - Done.
« Last Edit: May 10, 2015, 07:02:53 PM by Hanzo »

Offline Aika

  • Full Member
  • ***
  • Posts: 138
Re: Accommodation, House Percent and other Variables.
« Reply #25 on: May 11, 2015, 06:44:45 PM »
Interesting to see that some of my fingerprints are still on those files, even after so long. Sorry, crazy, for having disappeared for so long, but it looks like you've had things well in hand.

I noticed, though, you're not using my modifications to the g_Girls.Unequipcombat(girl) function. I had completely rewritten the code in the function from scratch to equip/unequip a girl before their shift if possible, and give a boolean return based on if the girl started her shift with her equipment on. Here's the code if you want to use it:

In each job (you'll have to figure out where each part goes in your own code, and will probably have to adjust some of this to fit your own coding conventions.)

Code: [Select]
//Put that shit away, you'll scare off the customers!
bool equipmentremoved = g_Girls.UnequipCombat(girl); //g_Girls.equipCombat(girl) is used instead for combat jobs

if (!equipmentremoved)
message+= "She started this shift wearing combat equipment. \n\n";



int scaredaway = 0



if (!equipmentremoved && g_Dice.percent(40))
g_Customers.AdjustNumCustomers(JOB_BARMAID, -1)
scaredaway++
continue;



if (scaredaway)
message+= ", but her combat equipment scared away " + intstring(scaredaway) + " of your customers";

cgirls.h around line 840:
Code: [Select]
    bool EquipCombat(sGirl* girl);  // girl makes sure best armor and weapons are equipped, ready for combat
    bool UnequipCombat(sGirl* girl);  // girl unequips armor and weapons, ready for brothel work or other non-aggressive jobs

cgirls.cpp starting around line 4100 (Or maybe not, if your cgirls.cpp has had a lot added or removed from it... search for the EquipCombat or UnequipCombat original functions)
Code: [Select]
bool cGirls::EquipCombat(sGirl* girl)
{  // girl makes sure best armor and weapons are equipped, ready for combat.
   // If this function finishes without the girl having at least an armor and one weapon, it returns false.   
    // First let's find out what's already equipped.
    bool combatequips = false;
    bool wearingArmor = false;
    bool wearingWeap1 = false;
    bool wearingWeap2 = false;
    int Armor, Weap1, Weap2, oldArmor, oldWeap1, oldWeap2;
    Armor = Weap1 = Weap2 = oldArmor = oldWeap1 = oldWeap2 = -1;
    for(int i=0; i<40; i++)
    {
        if(girl->m_Inventory[i] != 0) // Is there something here?
        {
            sInventoryItem* curItem = girl->m_Inventory[i];
            if((curItem->m_Type == INVWEAPON) || (curItem->m_Type == INVARMOR)) // Is it a weapon or armor?
                combatequips = true; // She does have an armor or weapon in her inventory.
            if((curItem->m_Type == INVWEAPON) && (girl->m_EquipedItems[i] != 0))
            { // I found a weapon that's already equipped.
                if(wearingWeap1) // She's equipped with 2 weapons, and I already found the other.
                { // This is her second weapon.
                    wearingWeap2 = true;
                    Weap2 = oldWeap2 = i;
                }
                else
                { // This is her first weapon.
                    wearingWeap1 = true;
                    Weap1 = oldWeap1 = i;
                }
            }
            if((curItem->m_Type == INVARMOR) && (girl->m_EquipedItems[i] != 0))
            { // I found the armor she has equipped.
                    wearingArmor = true;
                    Armor = oldArmor = i;
            }

        }
    }
    // If she doesn't have any armor or weapons in her inventory at all, nothing to do here.
    if(!combatequips)
        return false; // She's obviously not wearing an armor and one weapon.
   
    cConfig cfg; // We'll store the config file values for later.


    // The next bit assumes the cost of Weap1 is higher than the cost of Weap2. So...
    if(wearingWeap1 && wearingWeap2)
    {
        if(girl->m_Inventory[Weap2]->m_Cost > girl->m_Inventory[Weap1]->m_Cost)
        {
            int temp;
            temp = Weap1;
            Weap1 = Weap2;
            Weap2 = temp;
            oldWeap1 = Weap1;
            oldWeap2 = Weap2;
        }
    }
    // Look at each item.
    for(int i=0; i<40; i++)
    {
        if((girl->m_Inventory[i] != 0) && (girl->m_EquipedItems[i] = 0)) // Is it an item that's not equipped?
        {
            if(girl->m_Inventory[i]->m_Type == INVWEAPON) // Is it a weapon?
            {
                if(Weap1 != -1) // Does she already have one weapon?
                { //She already has one weapon.
                    if(girl->m_Inventory[i]->m_Cost > girl->m_Inventory[Weap1]->m_Cost) // Is this weapon better?
                    { //This weapon is better. Switch the weapon already here to her second weapon, and use this weapon here.
                        Weap2 = Weap1;
                        Weap1 = i;
                    }
                    else
                    { //The weapon she has here already is better. Look at her second weapon
                        if(Weap2 != -1) // Does she even have a second weapon?
                        { //She already has a second weapon.
                            if(girl->m_Inventory[i]->m_Cost > girl->m_Inventory[Weap2]->m_Cost) // Is this weapon better?
                                Weap2 = i; // Yes. Use it.
                        }
                        else // She doesn't have a second weapon.
                            Weap2 = i; // Use this one.
                    }
                }
                else // She doesn't have any weapon.
                    Weap1 = i; // Use this one.
                // If we made it here without changing weapons, both weapons she's wearing already are better.
            }
            if(girl->m_Inventory[i]->m_Type == INVARMOR) // Is it armor?
            {
                if(Armor != -1) // Is she already wearing any armor?
                { // She is wearing armor.
                    if(girl->m_Inventory[i]->m_Cost > girl->m_Inventory[Armor]->m_Cost) // Is this better?
                        Armor = i; // Yes. Use it.
                }
                else // She is not wearing armor.
                    Armor = i; // Use this.
                // If we made it here without changing armor, the armor she's wearing is better.
            }
        }
    }
    // If she's not already wearing an armor and one weapon, and the configuration file doesn't allow autoequipping,
    // then we need to end the function here. She isn't wearing an armor and at least one weapon, so returns false.
    if(!wearingArmor && !wearingWeap1 && !cfg.items.auto_combat_equip())
        return false;
   
            // if she's retarded, she might refuse or forget
    int refusal = 0;
    int refused = false;
    if(girl->has_trait("Retarded"))
        refusal += 30;
    if(g_Dice.percent(refusal))
        refused = true;

    // If we're changing her armor
    if(Armor != oldArmor)
    {
        if(cfg.items.auto_combat_equip()) // Are we allowed to do this?
        {
            if (!refused) // Did the girl refuse?
            {
                if(wearingArmor) // If she's not wearing armor, there's nothing to unequip.
                    g_InvManager.Unequip(girl, oldArmor);
                g_InvManager.Equip(girl, Armor, false); // Put on her best armor.
                wearingArmor = true;
            }
        }
    }
    // If we're changing her first weapon
    if(Weap1 != oldWeap1)
    {
        if(cfg.items.auto_combat_equip()) // Are we allowed to do this?
        {
            if(!refused) // Did the girl refuse?
            {
                if(wearingWeap1) // If she's not using a first weapon, there's nothing to unequip.
                    g_InvManager.Unequip(girl, oldWeap1);
                g_InvManager.Equip(girl, Weap1, false); // Put on her best weapon.
                wearingWeap1 = true;
            }
        }
    }
    // If we're changing her second weapon
    if(Weap2 != oldWeap2)
    {
        if(cfg.items.auto_combat_equip()) // Are we allowed to do this?
        {
            if(!refused) // Did the girl refuse?
            {
                if(wearingWeap2) // If she's not using a second weapon, there's nothing to unequip.
                    g_InvManager.Unequip(girl, oldWeap2);
                g_InvManager.Equip(girl, Weap2, false); // Put on her second best weapon.
                wearingWeap2 = true;
            }
        }
    }
    /* We need to check again to see if she's wearing a weapon and armor. I'm not sure if she
     * can actually make it here without having an armor and one weapon equipped, so this may
     * just be a sanity check.
     */
    if(!wearingArmor || !wearingWeap1)
        return false;

    return true; // If we made it here, she's at least wearing an armor and one weapon.
}

bool cGirls::UnequipCombat(sGirl* girl)
{  // girl unequips armor and weapons, ready for brothel work or other non-aggressive jobs   
    // First find out if she's wearing any in the first place
    bool combatequips = false;
    bool hasweaponorarmor = false;
    for(int i=0; i<40; i++)
    {
        if(girl->m_Inventory != 0)
        { // I found an item. What is it?
            sInventoryItem* curItem = girl->m_Inventory[i];
            if ((curItem->m_Type == INVWEAPON) || (curItem->m_Type == INVARMOR)) // Is it weapon or armor?
            {
                hasweaponorarmor = true;
                if(girl->m_EquipedItems != 0) // Is it equipped?
                    combatequips = true;
            }
        }
    }
    // If she doesn't have any armor or weapons, she's obviously not wearing any. Nothing to do here.
    if(!hasweaponorarmor)
        return true;

    cConfig cfg; // Look at the configuration file, store values for later.
    // if she's a really rough or crazy bitch, she might just keep combat gear equipped
    int refusal = 0;
    if(combatequips) // Is the crazy bitch even wearing anything?
    {
        if(girl->has_trait("Aggressive"))
            refusal += 30;
        if(girl->has_trait("Yandere"))
            refusal += 30;
        if(girl->has_trait("Twisted"))
            refusal += 30;
        if(girl->has_trait("Retarded"))
            refusal += 30;
        if(g_Dice.percent(refusal))
            return false;
    }
    for(int i=0; i<40; i++)
    {
        if((girl->m_Inventory != 0) && (girl->m_EquipedItems[i] != 0))
        { // I found an equipped item.
            sInventoryItem* curItem = girl->m_Inventory[i];
            if(curItem->m_Type == INVWEAPON || curItem->m_Type == INVARMOR) // Is it armor or weapon?
            { // Yes, it's an equipped armor or weapon.
                if(cfg.items.auto_combat_equip()) // Am I allowed to change this?
                    g_InvManager.Unequip(girl, i); // Yes, take it off.
                else
                    return false; // I can't take it off. She'll be wearing armor or weapon after this function ends.
            }       
        }
    }
    return true;
}
« Last Edit: May 11, 2015, 06:55:59 PM by Aika »

Offline crazy

  • Hero Member
  • *****
  • Posts: 733
Re: Accommodation, House Percent and other Variables.
« Reply #26 on: May 14, 2015, 08:36:28 PM »
While looking at the jobs I saw several sex events for nymphos, I was thinking if succubus should be able to trigger them too.
Yeah it should.  That makes senses
I'll see what I can do. I have some event ideas but they need some work.
If you need help feel free to ask.
There was a small mistake in the Sleazy Waitress job (nothing that can crash the game) and I posted a fix in the bug thread, I'm not sure if you've seen it.
EDIT - I missed the masseuse job. I'll upload both later.
EDIT 2 - Done.
Okay Ill get them added when I get a chance thanks.

Sorry for the late replay been to busy to do anything.

Interesting to see that some of my fingerprints are still on those files, even after so long. Sorry, crazy, for having disappeared for so long, but it looks like you've had things well in hand.

I noticed, though, you're not using my modifications to the g_Girls.Unequipcombat(girl) function. I had completely rewritten the code in the function from scratch to equip/unequip a girl before their shift if possible, and give a boolean return based on if the girl started her shift with her equipment on. Here's the code if you want to use it:

In each job (you'll have to figure out where each part goes in your own code, and will probably have to adjust some of this to fit your own coding conventions.)
Sorry for the late relay been slammed at work.  Lots of people been working on the mod since u been gone lol.  Maybe a few things you added that I over looked mergeing back when you stopped working on it.  I replayed to the PM you sent but it was on my phone so no idea if it sent or not.  You can let me know.

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Accommodation, House Percent and other Variables.
« Reply #27 on: May 22, 2015, 08:09:26 PM »
Yeah it should.  That makes senses
Ok, done.

If I have something new to add I'll post it in the writing help thread.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Accommodation, House Percent and other Variables.
« Reply #28 on: May 24, 2015, 12:48:02 PM »
Interesting to see that some of my fingerprints are still on those files, even after so long. Sorry, crazy, for having disappeared for so long, but it looks like you've had things well in hand.

I noticed, though, you're not using my modifications to the g_Girls.Unequipcombat(girl) function. I had completely rewritten the code in the function from scratch to equip/unequip a girl before their shift if possible, and give a boolean return based on if the girl started her shift with her equipment on. Here's the code if you want to use it:

In each job (you'll have to figure out where each part goes in your own code, and will probably have to adjust some of this to fit your own coding conventions.)

cgirls.cpp starting around line 4100 (Or maybe not, if your cgirls.cpp has had a lot added or removed from it... search for the EquipCombat or UnequipCombat original functions)
I like the idea but I'll make it into its own function to return what the girl has equipped.
Making it its own function will allow it to be used elsewhere in the code without changing what she is wearing.
Code: [Select]
/*    `J` Updated from Akia's suggestion and expanded return values
    returns 0 if she has no weapons or armor equipped
    returns 6 if she has one of each: weapon, armor, helmet, boots, shield
    returns 5 if she has weapons and armor (others ignored)
    returns 4 if she has weapons and no armor but at least one of helmet, boots or shield
    returns 3 if she has no weapons or armor but at least one of helmet, boots or shield
    returns 2 if she has only armor but no weapon (others ignored)
    returns 1 if she has only weapons
    returns -1 for errors
    */
int cGirls::CheckEquipment(sGirl* girl)
{
    if (girl->m_NumInventory <= 0) return 0;    // she has no items
    int foundw = 0;    int founda = 0;    int foundh = 0;    int foundc = 0;    int founds = 0;
    for (int i = 0; i < MAXNUM_GIRL_INVENTORY; i++)
    {
        if (girl->m_Inventory[i] != 0 && girl->m_EquipedItems[i] == 1)
        {
            if (girl->m_Inventory[i]->m_Type == INVWEAPON)            foundw = 1;
            if (girl->m_Inventory[i]->m_Type == INVARMOR)            founda = 1;
            if (girl->m_Inventory[i]->m_Type == INVHELMET)            foundh = 1;
            if (girl->m_Inventory[i]->m_Type == INVCOMBATSHOES)        foundc = 1;
            if (girl->m_Inventory[i]->m_Type == INVSHIELD)            founds = 1;
        }
    }

    if (foundw + founda + foundh + foundc + founds <= 0)            return 0;    // has nothing
    if (foundw + founda + foundh + foundc + founds >= 5)            return 6;    // has everything
    if (foundw == 1 && founda == 1)                                    return 5;    // has weapon and armor (others ignored)
    if (foundw == 1 && founda == 0 && foundh + foundc + founds > 0)    return 4;    // has weapon, no armor but at least one of helmet, boots or shield
    if (foundw == 0 && founda == 0 && foundh + foundc + founds > 0)    return 3;    // no weapon or armor but at least one of helmet, boots or shield
    if (foundw == 0 && founda == 1)                                    return 2;    // has armor but no weapons (others ignored)
    if (foundw == 1 && founda + foundh + foundc + founds <= 0)        return 1;    // has weapon only
    return -1;
}
« Last Edit: May 24, 2015, 01:09:33 PM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Accommodation, House Percent and other Variables.
« Reply #29 on: May 25, 2015, 11:50:51 AM »
I added Ask Price to House Percent and Ask Price as well as updated the game a little to make intelligence and confidence let the girl charge more that the max 100.
If a girl has 100 int and conf she may be able to charge a max of 126 per customer.
Not sure if this will work but we'll see.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug