Ticket #38: mypatch.patch

File mypatch.patch, 9.7 KB (added by bigjj13, 21 months ago)
  • C:/Cafu-src-r76/Games/DeathMatch/Code/

    old new  
    169169    // Only human players that are still alive can take damage. 
    170170    if (State.StateOfExistance!=StateOfExistance_Alive) return; 
    171171 
    172     State.Velocity=State.Velocity+scale(VectorT(ImpactDir.x, ImpactDir.y, 0.0), 500.0*Amount); 
     172    State.Velocity=State.Velocity+scale(VectorT(ImpactDir.x, ImpactDir.y, 0.0), 100.0*Amount); 
    173173 
    174174    if (State.Health<=Amount) 
    175175    { 
     
    237237        ModelProxyT("Games/DeathMatch/Models/Players/Sentinel.mdl"), 
    238238        ModelProxyT("Games/DeathMatch/Models/Players/Skeleton.mdl"), 
    239239        ModelProxyT("Games/DeathMatch/Models/Players/T801.mdl"    ), 
     240                ModelProxyT("Games/DeathMatch/Models/Players/Jaffa.mdl"   ), 
     241                ModelProxyT("Games/DeathMatch/Models/Players/USCM.mdl"    ), 
    240242        ModelProxyT("Games/DeathMatch/Models/Players/Trinity.mdl" ) 
    241243    }; 
    242244 
     
    258260        else if (_stricmp((const char*)ConfigData, "Sentinel")==0) State.ModelIndex=3; 
    259261        else if (_stricmp((const char*)ConfigData, "Skeleton")==0) State.ModelIndex=4; 
    260262        else if (_stricmp((const char*)ConfigData, "T801"    )==0) State.ModelIndex=5; 
    261         else                                                       State.ModelIndex=6; 
     263                else if (_stricmp((const char*)ConfigData, "Jaffa"   )==0) State.ModelIndex=6; 
     264                else if (_stricmp((const char*)ConfigData, "USCM"    )==0) State.ModelIndex=7; 
     265        else                                                       State.ModelIndex=8; 
    262266    } 
    263267 
    264268    // player name 
     
    410414 
    411415                VectorT             WishVelocity; 
    412416                bool                WishJump=false; 
    413                 const double        VelX    =6000.0*LookupTables::Angle16ToSin[State.Heading];     // 6000 == Client.MoveSpeed 
    414                 const double        VelY    =6000.0*LookupTables::Angle16ToCos[State.Heading];     // 6000 == Client.MoveSpeed 
     417                                char                            Runspon=0; 
     418                const double        VelX    =3000.0*LookupTables::Angle16ToSin[State.Heading];     // 6000 == Client.MoveSpeed 
     419                const double        VelY    =3000.0*LookupTables::Angle16ToCos[State.Heading];     // 6000 == Client.MoveSpeed 
    415420                const unsigned long Keys    =PlayerCommands[PCNr].Keys; 
    416421 
    417422                if (Keys & PCK_MoveForward ) WishVelocity=             VectorT( VelX,  VelY, 0); 
    418                 if (Keys & PCK_MoveBackward) WishVelocity=WishVelocity+VectorT(-VelX, -VelY, 0); 
     423                if (Keys & PCK_MoveBackward)  
     424                                { 
     425                                        WishVelocity=WishVelocity+VectorT(-VelX, -VelY, 0); 
     426                                        Runspon=3; 
     427                                } 
    419428                if (Keys & PCK_StrafeLeft  ) WishVelocity=WishVelocity+VectorT(-VelY,  VelX, 0); 
    420429                if (Keys & PCK_StrafeRight ) WishVelocity=WishVelocity+VectorT( VelY, -VelX, 0); 
    421430 
    422431                if (Keys & PCK_CenterView  ) { State.Pitch=0; State.Bank=0; } 
    423                 if (Keys & PCK_Jump        ) WishJump=true; 
     432                if (Keys & PCK_Jump        )  
     433                                { 
     434                                        WishJump=true; 
     435                                        Runspon=2; 
     436                                } 
    424437             // if (Keys & PCK_Duck        ) ; 
    425                 if (Keys & PCK_Walk        ) WishVelocity=scale(WishVelocity, 0.5); 
     438                if (Keys & PCK_Walk        )  
     439                                { 
     440                                        if (Runspon!=3) 
     441                                        { 
     442                                                WishVelocity=scale(WishVelocity, 2.0);                                  //Run 
     443                                                if (Runspon==3) Runspon=4; 
     444                                                else Runspon=1; 
     445                                        } 
     446                                } 
    426447 
    427448                VectorT       WishVelLadder; 
    428449                const double  ViewLadderZ=-LookupTables::Angle16ToSin[State.Pitch]; 
    429450                const double  ViewLadderY= LookupTables::Angle16ToCos[State.Pitch]; 
    430                 const VectorT ViewLadder =scale(VectorT(ViewLadderY*LookupTables::Angle16ToSin[State.Heading], ViewLadderY*LookupTables::Angle16ToCos[State.Heading], ViewLadderZ), 3800.0); 
     451                const VectorT ViewLadder =scale(VectorT(ViewLadderY*LookupTables::Angle16ToSin[State.Heading], ViewLadderY*LookupTables::Angle16ToCos[State.Heading], ViewLadderZ), 1900.0); 
    431452 
    432453                // TODO: Also take LATERAL movement into account. 
    433454                // TODO: All this needs a HUGE clean-up! Can probably put a lot of this stuff into Physics::MoveHuman. 
    434455                if (Keys & PCK_MoveForward ) WishVelLadder=WishVelLadder+ViewLadder; 
    435456                if (Keys & PCK_MoveBackward) WishVelLadder=WishVelLadder-ViewLadder; 
    436                 if (Keys & PCK_Walk        ) WishVelLadder=scale(WishVelLadder, 0.5); 
     457                if (Keys & PCK_Walk        ) WishVelLadder=scale(WishVelLadder, 2.0); 
    437458 
    438459                /*if (Clients[ClientNr].move_noclip) 
    439460                { 
     
    469490                    XYVel.z=0; 
    470491                    double NewSpeed=length(XYVel); 
    471492 
    472                     if (OldSpeed<=1000.0 && NewSpeed>1000.0) State.ModelSequNr=3; 
    473                     if (OldSpeed>=1000.0 && NewSpeed<1000.0) State.ModelSequNr=1; 
     493                    if (OldSpeed<=1000.0 && NewSpeed>1000.0)  
     494                                        { 
     495                                                if (Runspon==1) State.ModelSequNr=3; 
     496                                                else    if (Runspon==2) State.ModelSequNr=8; 
     497                                                                else    if (Runspon==3) State.ModelSequNr=77; 
     498                                                                                else    if (Runspon==4) State.ModelSequNr=9; 
     499                                                                                                else State.ModelSequNr=4; 
     500                                        } 
     501                    if (OldSpeed>=1000.0 && NewSpeed<1000.0) 
     502                                        { 
     503                                                if (Runspon==2) State.ModelSequNr=8; 
     504                                                else State.ModelSequNr=1; 
     505                                        } 
    474506                } 
    475507 
    476508                // GameWorld->ModelAdvanceFrameTime() is called on client side in Draw(). 
     
    551583                            case WEAPON_SLOT_9MMAR       : DrawSequNr=4; break; 
    552584                            case WEAPON_SLOT_CROSSBOW    : DrawSequNr=5; break; 
    553585                            case WEAPON_SLOT_RPG         : DrawSequNr=5; break; 
    554                             case WEAPON_SLOT_GAUSS       : DrawSequNr=8; break; 
     586                            case WEAPON_SLOT_GAUSS       : DrawSequNr=2; break; 
    555587                            case WEAPON_SLOT_EGON        : DrawSequNr=9; break; 
    556588                            case WEAPON_SLOT_GRENADE     : DrawSequNr=7; break; 
    557589                            case WEAPON_SLOT_TRIPMINE    : DrawSequNr=0; break; 
     
    581613                            case WEAPON_SLOT_9MMAR       : DrawSequNr=4; break; 
    582614                            case WEAPON_SLOT_CROSSBOW    : DrawSequNr=5; break; 
    583615                            case WEAPON_SLOT_RPG         : DrawSequNr=5; break; 
    584                             case WEAPON_SLOT_GAUSS       : DrawSequNr=8; break; 
     616                            case WEAPON_SLOT_GAUSS       : DrawSequNr=2; break; 
    585617                            case WEAPON_SLOT_EGON        : DrawSequNr=9; break; 
    586618                            case WEAPON_SLOT_GRENADE     : DrawSequNr=7; break; 
    587619                            case WEAPON_SLOT_TRIPMINE    : DrawSequNr=0; break; 
     
    754786                // Now leave it only after we have come to a complete halt, and the death sequence is over. 
    755787                if (OldOriginZ>=State.Origin.z && fabs(State.Velocity.x)<0.1 && fabs(State.Velocity.y)<0.1 && fabs(State.Velocity.z)<0.1 && OldModelFrameNr==State.ModelFrameNr) 
    756788                { 
    757                     std::map<std::string, std::string> Props; Props["classname"]="corpse"; 
     789                    if (ThinkingOnServerSide) 
     790                    { 
     791                        std::map<std::string, std::string> Props; Props["classname"]="corpse"; 
    758792 
    759                     // Create a new "corpse" entity in the place where we died, or else the model disappears. 
    760                     unsigned long CorpseID=GameWorld->CreateNewEntity(Props, ServerFrameNr, VectorT()); 
     793                        // Create a new "corpse" entity in the place where we died, or else the model disappears. 
     794                        unsigned long CorpseID=GameWorld->CreateNewEntity(Props, ServerFrameNr, VectorT()); 
    761795 
    762                     if (CorpseID!=0xFFFFFFFF) 
    763                     { 
    764                         BaseEntityT* Corpse=GameWorld->GetBaseEntityByID(CorpseID); 
     796                        if (CorpseID!=0xFFFFFFFF) 
     797                        { 
     798                            BaseEntityT* Corpse=GameWorld->GetBaseEntityByID(CorpseID); 
    765799 
    766                         Corpse->State=EntityStateT(State.Origin+VectorT(0.0, 0.0, State.Dimensions.Min.z+1728.8), VectorT(), BoundingBox3T<double>(Vector3dT()), State.Heading, 
    767                                                    0, 0, 0, 0, State.ModelIndex, State.ModelSequNr, State.ModelFrameNr, 0, 0, 0, 0, 
    768                                                    State.ActiveWeaponSlot, 0, 0.0); 
     800                            Corpse->State=EntityStateT(State.Origin+VectorT(0.0, 0.0, State.Dimensions.Min.z+1728.8), VectorT(), BoundingBox3T<double>(Vector3dT()), State.Heading, 
     801                                                       0, 0, 0, 0, State.ModelIndex, State.ModelSequNr, State.ModelFrameNr, 0, 0, 0, 0, 
     802                                                       State.ActiveWeaponSlot, 0, 0.0); 
     803                        } 
    769804                    } 
    770805 
    771806                    State.Velocity.y=State.Heading; 
     
    10411076 
    10421077        // This is a compromise for the not-so-great code in the constructor: 
    10431078        // Obtain a pointer to our GUI if we haven't one already (so this is a one-time issue). 
    1044         if (GuiHUD==NULL) GuiHUD=cf::GuiSys::GuiMan->Find("Games/DeathMatch/GUIs/HUD.cgui", true); 
     1079        if (GuiHUD==NULL) GuiHUD=cf::GuiSys::GuiMan->Find("Games/DeathMatch/GUIs/HUD_main.cgui", true); 
    10451080 
    10461081        // Decide whether the GuiHUD should be drawn at all. 
    10471082        const bool ActivateHUD=State.StateOfExistance==StateOfExistance_Alive || State.StateOfExistance==StateOfExistance_Dead;