Changeset 3

Show
Ignore:
Timestamp:
03/18/04 06:07:42 (6 years ago)
Author:
fon
Message:

Major update:
The statistics in MatchPlayer.java has been centralised in the private Statistic Class
The MVP for the time race game has be calcualted via function in the comments
The MVP is only implemented for time race but if it is a good idea the same mvp system can be implemented to all base games for now.

Location:
trunk/twcore/twcore/bots/matchbot
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/twcore/twcore/bots/matchbot/MatchPlayer.java

    r2 r3  
    6060 
    6161        // regular game stats 
    62         int m_fnKills = 0, m_fnDeaths = 0, m_fnScore = 0, m_fnShipType = 0, m_fnSpecAt = 10, m_fnFrequency = 0, m_fnLagouts = 0, 
     62        int m_fnShipType = 0, m_fnSpecAt = 10, m_fnFrequency = 0, m_fnLagouts = 0, 
    6363        /* playerstate: 0 - Not In Game (0 deaths) 
    6464                        1 - In Game 
     
    7777        static int OUT = 4; 
    7878 
     79        //statistic tracker 
     80        private Statistics m_statisticTracker; 
     81         
    7982        /** Creates a new instance of MatchPlayer */ 
    8083        public MatchPlayer(String fcPlayerName, MatchTeam Matchteam) 
     
    100103                maxStandardDeviation = m_rules.getDouble("maxstandarddeviation"); 
    101104                maxNumSpikes = m_rules.getInt("maxnumspikes"); 
     105 
     106                //statistics tracker 
     107                m_statisticTracker = new Statistics(m_fnShipType); 
    102108 
    103109                if ((m_rules.getInt("storegame") != 0) || (m_rules.getInt("rosterjoined") != 0)) 
     
    223229 
    224230        // report kill 
    225         public void reportKill(int fnPoints) 
    226         { 
    227                 m_fnKills++; 
    228                 m_fnScore += fnPoints; 
     231        public void reportKill(int fnPoints, int killeeID) 
     232        { 
     233                int shipType = m_botAction.getPlayer(killeeID).getShipType(); 
     234                int killeeFreq = m_botAction.getPlayer(killeeID).getFrequency(); 
     235                 
     236                if (killeeFreq == m_fnFrequency) 
     237                { 
     238                        m_statisticTracker.setTeamKills(); 
     239                } 
     240                else 
     241                { 
     242                        switch (shipType) 
     243                        { 
     244                                case 1 : //wb 
     245                                        m_statisticTracker.setWbKill(); 
     246                                        break; 
     247 
     248                                case 2 : //jav 
     249                                        m_statisticTracker.setJavKill(); 
     250                                        break; 
     251 
     252                                case 3 : //spider 
     253                                        m_statisticTracker.setSpiderKill(); 
     254                                        break; 
     255 
     256                                case 4 : //lev 
     257                                        m_statisticTracker.setLevKill(); 
     258                                        break; 
     259 
     260                                case 5 : //terr 
     261                                        m_statisticTracker.setTerrKill(); 
     262                                        break; 
     263 
     264                                case 6 : //x 
     265                                        m_statisticTracker.setWeaselKill(); 
     266                                        break; 
     267 
     268                                case 7 : //lanc 
     269                                        m_statisticTracker.setLancKill(); 
     270                                        break; 
     271 
     272                                case 8 : //shark 
     273                                        m_statisticTracker.setSharkKill(); 
     274                                        break; 
     275                        } 
     276                } 
     277 
     278                m_statisticTracker.setScore(fnPoints); 
    229279                if (m_currentShip != null) 
    230280                        m_currentShip.reportKill(fnPoints); 
    231281        }; 
    232282 
     283        /** 
     284         * Method reportFlagClaimed. 
     285         *  
     286         * Adds flagclaimed to stats 
     287         */ 
     288        public void reportFlagClaimed() 
     289        { 
     290                m_statisticTracker.setFlagClaimed(); 
     291        } 
     292 
    233293        // report death 
    234294        public void reportDeath() 
    235295        { 
    236                 m_fnDeaths++; 
     296                m_statisticTracker.setDeaths(); 
     297                if (m_fnShipType == 8) //shark 
     298                        m_statisticTracker.setAverageRepelCount(m_botAction.getPlayer(m_fcPlayerName).getRepelCount()); 
     299                 
    237300                resetOutOfBorderTime(); 
    238301                if (m_currentShip != null) 
    239302                        m_currentShip.reportDeath(); 
    240                 if ((m_fnDeaths >= m_fnSpecAt) && (m_rules.getInt("deaths") > 0)) 
     303                if ((m_statisticTracker.getDeaths() >= m_fnSpecAt) && (m_rules.getInt("deaths") > 0)) 
    241304                { 
    242305                        if (m_fnPlayerState != 2) 
     
    269332                if (lagRequestTask != null) 
    270333                        lagRequestTask.cancel(); 
    271                 m_fnSpecAt = m_fnDeaths; 
     334                m_fnSpecAt = m_statisticTracker.getDeaths(); 
    272335                if (m_currentShip != null) 
    273336                        m_currentShip.endNow(); 
     
    312375                                                        }; 
    313376                                                         */ 
    314                                                         if (m_fnKills == 0 && m_fnDeaths == 0) 
     377                                                        if (m_statisticTracker.getTotalKills() == 0 && m_statisticTracker.getDeaths() == 0) 
    315378                                                                m_botAction.shipReset(m_fcPlayerName); 
    316379                                                        getInGame(true); 
     
    397460        public void flagReward(int points) 
    398461        { 
    399                 m_fnScore = m_fnScore + points; 
     462                m_statisticTracker.setScore(points); 
    400463                if (m_currentShip != null) 
    401464                        m_currentShip.flagReward(points); 
     
    421484        { 
    422485                if ((m_fnPlayerState >= 1) && (m_fnPlayerState <= 2)) 
    423                         return m_fnDeaths; 
     486                        return m_statisticTracker.getDeaths(); 
    424487                if (m_fnPlayerState == 0) 
    425488                        return 0; 
     
    499562                else if (winby.equals("timerace")) 
    500563                { 
    501                         return getRating(); 
     564                        return m_statisticTracker.getRating(); 
    502565                } 
    503566                return 0; 
    504567        } 
    505568 
    506         /** 
    507          * Method getRating. 
    508          * This returns the rating for the player according to this: 
    509          *  
    510          * spiders: points * .8kills/deaths * (1 + .125x + .01y) 
    511          * x = terr kills 
    512          * y = shark kills 
    513          *  
    514          * warbird: points * (1 + (2x + y)/z) 
    515          * x = terr kills  
    516          * y = shark kills 
    517          * z = kills 
    518          *  
    519          * terr: points * .5(x/y) 
    520          * x = total cumulative bounty - 3y 
    521          * y = deaths 
    522          *  
    523          * jav: points * (1 + .05x - .1y) * (1 + .z) 
    524          * x = kills 
    525          * y = teamkills 
    526          * z = terr kills 
    527          *  
    528          * shark: team points/8 * (1 + .02x - .05y + .1z) * (1 + x/a) 
    529          * x = kills 
    530          * y = teamkills 
    531          * z = terr kills 
    532          * a = deaths 
    533          *  
    534          * Original idea by Randedl 
    535          *  
    536          * @author FoN 
    537          *  
    538          * @return int which is the rating depending on the shiptype 
    539          */ 
    540         private int getRating() 
    541         { 
    542                 int rating = 0; 
    543  
    544                 switch (getShipType()) 
    545                 { 
    546                         case 1 : //warbird 
    547                                 rating = (int) (getScore() * (0.8 * getKills() / getDeaths()) * (1 + .125)); 
    548                                 return rating; 
    549  
    550                         case 2 : //jav 
    551                                 rating = getScore(); 
    552                                 return rating; 
    553  
    554                         case 3 : //spider 
    555                                 rating = getScore(); 
    556                                 return rating; 
    557  
    558                         case 4 : //lev 
    559                                 rating = getScore(); 
    560                                 return rating; 
    561  
    562                         case 5 : //terr 
    563                                 rating = getScore(); 
    564                                 return rating; 
    565  
    566                         case 6 : //weasel 
    567                                 rating = getScore(); 
    568                                 return rating; 
    569  
    570                         case 7 : //lanc 
    571                                 rating = getScore(); 
    572                                 return rating; 
    573  
    574                         case 8 : //shark 
    575                                 rating = getScore(); 
    576                                 return rating; 
    577  
    578                         default : //if errored 
    579                                 rating = getScore(); 
    580                                 return rating; 
    581                 } 
    582  
    583         }; 
     569 
     570        ; 
    584571 
    585572        public long getOutOfBorderTime() 
     
    612599                if (lagRequestTask != null) 
    613600                        lagRequestTask.cancel(); 
    614                 m_fnDeaths = 10; 
     601                 
     602                m_statisticTracker.changeDeaths(10); 
     603                 
    615604                m_logger.specAndSetFreq(m_fcPlayerName, m_team.getFrequency()); 
    616605                m_logger.sendArenaMessage(getPlayerName() + " is out (too long outside of base). " + getKills() + " wins " + getDeaths() + " losses"); 
     
    619608        public int getActualDeaths() 
    620609        { 
    621                 return m_fnDeaths; 
     610                return m_statisticTracker.getDeaths(); 
    622611        }; 
    623612        public int getKills() 
    624613        { 
    625                 return m_fnKills; 
     614                return m_statisticTracker.getTotalKills(); 
    626615        }; 
    627616        public int getScore() 
    628617        { 
    629                 return m_fnScore; 
     618                return m_statisticTracker.getScore(); 
    630619        }; 
    631620        public int getSpecAt() 
     
    731720                } 
    732721        } 
     722         
     723        /** 
     724         * @author FoN 
     725         *  
     726         * This class is to congregate all the stats so they can be organised and added + removed easily 
     727         */ 
     728        private class Statistics 
     729        { 
     730                //stats 
     731                private int m_wbKill; 
     732                private int m_javKill; 
     733                private int m_spiderKill; 
     734                private int m_levKill; 
     735                private int m_terrKill; 
     736                private int m_weaselKill; 
     737                private int m_lancKill; 
     738                private int m_sharkKill; 
     739                private int m_deaths; 
     740                private int m_score; 
     741                private int m_teamKills; 
     742                private int m_avgRepelCount; 
     743                private int m_flagClaimed; 
     744 
     745                //others 
     746                private int m_shipType; 
     747                 
     748                private final int MAXIMUM_RATIO = 4; 
     749 
     750                public Statistics(int shipType) 
     751                { 
     752                        m_shipType = shipType; 
     753                        reset(); 
     754                } 
     755 
     756                /** 
     757                 * Method getRating. 
     758                 * This returns the rating for the player according to this: 
     759                 *  
     760                 * warbird: points * (1 + (2x + y)/z) * (1 + 0.1x + 0.01y) 
     761                 * x = terr kills  
     762                 * y = shark kills 
     763                 * z = kills 
     764                 * 
     765                 * jav: points * (1 + .05x - .1y) * (1 + 0.1z) 
     766                 * x = kills 
     767                 * y = teamkills 
     768                 * z = terr kills 
     769                 * 
     770                 * spiders: points * .8kills/deaths * (1 + .05x + .005y) 
     771                 * x = terr kills 
     772                 * y = shark kills 
     773                 *  
     774                 * terr: points * (x/y) * (1 + 0.05z) 
     775                 * x = kills 
     776                 * y = deaths 
     777                 * z = terr kills 
     778                 * 
     779                 * weasel: points * (x/y) * (1 + 0.2z + 0.2a) 
     780                 * x = kills 
     781                 * y = deaths 
     782                 * z = terr kills 
     783                 * a = num of times flag claimed 
     784                 *  
     785                 * lanc: points * (x/y) * (1 + 0.05z + 0.001(a + b + c + d)) 
     786                 * x = kills 
     787                 * y = deaths 
     788                 * z = terr kills 
     789                 * a = jav kills 
     790                 * b = lanc kills 
     791                 * c = weasel kills 
     792                 * d = wb kills 
     793                 *   
     794                 * shark: points * (1 + .02x - .05y + .1z) * (1 + 0.4(x/a)) * (3 / avgRepelCount) 
     795                 * x = kills 
     796                 * y = teamkills 
     797                 * z = terr kills 
     798                 * a = deaths 
     799                 *  
     800                 * Original idea by Randedl 
     801                 *  
     802                 * @author FoN 
     803                 *  
     804                 * @return int which is the rating depending on the shiptype 
     805                 */ 
     806                public int getRating() 
     807                { 
     808                        int rating = 0; 
     809 
     810                        switch (m_shipType) 
     811                        { 
     812                                case 1 : //warbird 
     813                                        if (getTotalKills() == 0) //can't divide by zero 
     814                                                return (int) (m_score * MAXIMUM_RATIO * (1 + 0.1 * m_terrKill + 0.01 * m_sharkKill)); 
     815                                        rating = (int) (m_score * (1 + (2 * m_terrKill + m_sharkKill/getTotalKills())) * (1 + 0.1 * m_terrKill + 0.01 * m_sharkKill)); 
     816                                        return rating; 
     817 
     818                                case 2 : //jav 
     819                                        rating = (int) (m_score * (1 + 0.05 * getTotalKills() - 0.1 * m_teamKills) * (1 + 0.1 * m_terrKill)); 
     820                                        return rating; 
     821 
     822                                case 3 : //spider                                
     823                                        if (m_deaths == 0) //can't divide by zero 
     824                                                return (int) (m_score * MAXIMUM_RATIO * (1 + 0.05 * m_terrKill + 0.005 * m_sharkKill)); 
     825                                        rating = (int) (m_score * (0.8 * getTotalKills() / m_deaths) * (1 + 0.05 * m_terrKill + 0.005 * m_sharkKill)); 
     826                                        return rating; 
     827 
     828                                case 4 : //lev 
     829                                        rating = m_score; 
     830                                        return rating; 
     831 
     832                                case 5 : //terr 
     833                                        if (m_deaths == 0) 
     834                                                return (int) (m_score * MAXIMUM_RATIO * (1 + 0.05 * m_terrKill)); //can't divide by zero 
     835                                        rating = (int) (m_score * (getTotalKills() / m_deaths) * (1 + 0.5 * m_terrKill)); 
     836                                        return rating; 
     837 
     838                                case 6 : //weasel 
     839                                        if (m_deaths == 0) //can't divide by zero 
     840                                                return (int) (m_score * MAXIMUM_RATIO * (1 + 0.2 * m_terrKill + 0.2 * m_flagClaimed)); 
     841                                        rating = (int) (m_score * (getTotalKills()/m_deaths) * (1 + 0.2 * m_terrKill + 0.2 * m_flagClaimed)); 
     842                                        return rating; 
     843 
     844                                case 7 : //lanc 
     845                                        if (m_deaths == 0) //can't divide by zero 
     846                                                return (int) (m_score * MAXIMUM_RATIO * (1 + 0.05 * m_terrKill + 0.001 * (m_wbKill + m_javKill + m_weaselKill + m_lancKill))); 
     847                                        rating = (int) (m_score * (getTotalKills()/m_deaths) * (1 + 0.05 * m_terrKill + 0.001 * (m_wbKill + m_javKill + m_weaselKill + m_lancKill))); 
     848                                        return rating; 
     849 
     850                                case 8 : //shark 
     851                                        if (m_deaths == 0 && (getAverageRepelCount() != 0)) 
     852                                                return (int) (m_score * (1 + 0.02 * getTotalKills() - 0.05 * m_teamKills + 0.1 * m_terrKill) * (1 +  0.4 * MAXIMUM_RATIO) * (3 / getAverageRepelCount())); 
     853                                        else if (m_deaths == 0 && getAverageRepelCount() == 0) 
     854                                                return (int) (m_score * (1 + 0.02 * getTotalKills() - 0.05 * m_teamKills + 0.1 * m_terrKill) * (1 +  0.4 * MAXIMUM_RATIO) * MAXIMUM_RATIO); 
     855                                        else if (getAverageRepelCount() == 0) 
     856                                                return (int) (m_score * (1 + 0.02 * getTotalKills() - 0.05 * m_teamKills + 0.1 * m_terrKill) * (1 +  0.4 * getTotalKills() / m_deaths) * MAXIMUM_RATIO);         
     857                                        else 
     858                                        { 
     859                                                rating = (int) (m_score * (1 + 0.02 * getTotalKills() - 0.05 * m_teamKills + 0.1 * m_terrKill) * (1 +  0.4 * getTotalKills() / m_deaths) * (3 / getAverageRepelCount())); 
     860                                                return rating; 
     861                                        } 
     862 
     863                                default : //if errored 
     864                                        rating = m_score; 
     865                                        return rating; 
     866                        } 
     867 
     868                } 
     869 
     870                /** 
     871                 * sets all the stat variables to zero or their initial values 
     872                 */ 
     873                private void reset() 
     874                { 
     875                        m_wbKill = 0; 
     876                        m_javKill = 0; 
     877                        m_spiderKill = 0; 
     878                        m_levKill = 0; 
     879                        m_terrKill = 0; 
     880                        m_weaselKill = 0; 
     881                        m_lancKill = 0; 
     882                        m_sharkKill = 0; 
     883                        m_deaths = 0; 
     884                        m_score = 0; 
     885                        m_teamKills = 0; 
     886                        m_flagClaimed = 0; 
     887                        m_avgRepelCount = 0; 
     888                } 
     889 
     890                /** 
     891                 * Adds up all the shiptype kills and returns total 
     892                 * @return int 
     893                 */ 
     894                public int getTotalKills() 
     895                { 
     896                        return m_wbKill + m_javKill + m_spiderKill + m_levKill + m_terrKill + m_weaselKill + m_lancKill + m_sharkKill; 
     897                } 
     898 
     899                public float getKillDeathRatio() 
     900                { 
     901                        if (m_deaths == 0) //cant divide by zero 
     902                                return getTotalKills(); 
     903                        return getTotalKills() / m_deaths; 
     904                } 
     905 
     906                /** 
     907                 * Returns the m_javKill. 
     908                 * @return int 
     909                 */ 
     910                public int getJavKill() 
     911                { 
     912                        return m_javKill; 
     913                } 
     914 
     915                /** 
     916                 * Returns the m_lancKill. 
     917                 * @return int 
     918                 */ 
     919                public int getLancKill() 
     920                { 
     921                        return m_lancKill; 
     922                } 
     923 
     924                /** 
     925                 * Returns the m_levKill. 
     926                 * @return int 
     927                 */ 
     928                public int getLevKill() 
     929                { 
     930                        return m_levKill; 
     931                } 
     932 
     933                /** 
     934                 * Returns the m_sharkKill. 
     935                 * @return int 
     936                 */ 
     937                public int getSharkKill() 
     938                { 
     939                        return m_sharkKill; 
     940                } 
     941 
     942                /** 
     943                 * Returns the m_spiderKill. 
     944                 * @return int 
     945                 */ 
     946                public int getSpiderKill() 
     947                { 
     948                        return m_spiderKill; 
     949                } 
     950 
     951                /** 
     952                 * Returns the m_terrKill. 
     953                 * @return int 
     954                 */ 
     955                public int getTerrKill() 
     956                { 
     957                        return m_terrKill; 
     958                } 
     959 
     960                /** 
     961                 * Returns the m_wbKill. 
     962                 * @return int 
     963                 */ 
     964                public int getWbKill() 
     965                { 
     966                        return m_wbKill; 
     967                } 
     968 
     969                /** 
     970                 * Returns the m_weaselKill. 
     971                 * @return int 
     972                 */ 
     973                public int getWeaselKill() 
     974                { 
     975                        return m_weaselKill; 
     976                } 
     977 
     978                /** 
     979                 * Sets the m_javKill. 
     980                 * Increments it by one 
     981                 */ 
     982                public void setJavKill() 
     983                { 
     984                        m_javKill++; 
     985                } 
     986 
     987                /** 
     988                 * Sets the m_lancKill. 
     989                 * Increments it by one 
     990                 */ 
     991                public void setLancKill() 
     992                { 
     993                        m_lancKill++; 
     994                } 
     995 
     996                /** 
     997                 * Sets the m_levKill. 
     998                 * Increments it by one 
     999                 */ 
     1000                public void setLevKill() 
     1001                { 
     1002                        m_levKill++; 
     1003                } 
     1004 
     1005                /** 
     1006                 * Sets the m_sharkKill. 
     1007                 * Increments it by one 
     1008                         */ 
     1009                public void setSharkKill() 
     1010                { 
     1011                        m_sharkKill++; 
     1012                } 
     1013 
     1014                /** 
     1015                 * Sets the m_spiderKill. 
     1016                 * Increments it by one 
     1017                 */ 
     1018                public void setSpiderKill() 
     1019                { 
     1020                        m_spiderKill++; 
     1021                } 
     1022 
     1023                /** 
     1024                 * Sets the m_terrKill. 
     1025                 * Increments it by one 
     1026                 */ 
     1027                public void setTerrKill() 
     1028                { 
     1029                        m_terrKill++; 
     1030                } 
     1031 
     1032                /** 
     1033                 * Sets the m_wbKill. 
     1034                 * Increments it by one 
     1035                 */ 
     1036                public void setWbKill() 
     1037                { 
     1038                        m_wbKill++; 
     1039                } 
     1040 
     1041                /** 
     1042                 * Sets the m_weaselKill. 
     1043                 * Increments it by one 
     1044                 */ 
     1045                public void setWeaselKill() 
     1046                { 
     1047                        m_weaselKill++; 
     1048                } 
     1049 
     1050                /** 
     1051                 * Returns the m_deaths. 
     1052                 * @return int 
     1053                 */ 
     1054                public int getDeaths() 
     1055                { 
     1056                        return m_deaths; 
     1057                } 
     1058 
     1059                /** 
     1060                 * Sets the m_deaths. 
     1061                 */ 
     1062                public void setDeaths() 
     1063                { 
     1064                        m_deaths++; 
     1065                } 
     1066 
     1067                /** 
     1068                 * Changes the death via the input 
     1069                 * @ param deaths The deaths to be changed to 
     1070                 */ 
     1071                public void changeDeaths(int deaths) 
     1072                { 
     1073                        m_deaths = deaths; 
     1074                } 
     1075 
     1076                /** 
     1077                 * Returns the m_score. 
     1078                 * @return int 
     1079                 */ 
     1080                public int getScore() 
     1081                { 
     1082                        return m_score; 
     1083                } 
     1084 
     1085                /** 
     1086                 * Adds to the m_score. 
     1087                 * @param score The m_score to set 
     1088                 */ 
     1089                public void setScore(int score) 
     1090                { 
     1091                        m_score += score; 
     1092                } 
     1093 
     1094                /** 
     1095                 * Returns the m_teamKills. 
     1096                 * @return int 
     1097                 */ 
     1098                public int getTeamKills() 
     1099                { 
     1100                        return m_teamKills; 
     1101                } 
     1102 
     1103                /** 
     1104                 * Sets the m_teamKills. 
     1105                 */ 
     1106                public void setTeamKills() 
     1107                { 
     1108                        m_teamKills++; 
     1109                } 
     1110 
     1111                /** 
     1112                 * Returns the m_avgRepelCount. 
     1113                 * @return int 
     1114                 */ 
     1115                public int getAverageRepelCount() 
     1116                { 
     1117                        if (m_deaths == 0) 
     1118                                return m_avgRepelCount / 1; //can't divide by zero; 
     1119                        return m_avgRepelCount/m_deaths; 
     1120                } 
     1121 
     1122                /** 
     1123                 * Returns the m_flagClaimed. 
     1124                 * @return int 
     1125                 */ 
     1126                public int getFlagClaimed() 
     1127                { 
     1128                        return m_flagClaimed; 
     1129                } 
     1130 
     1131                /** 
     1132                 * Sets the m_avgRepelCount. 
     1133                 * @param m_avgRepelCount The m_avgRepelCount to set 
     1134                 */ 
     1135                public void setAverageRepelCount(int avgRepelCount) 
     1136                { 
     1137                        m_avgRepelCount += avgRepelCount; 
     1138                } 
     1139 
     1140                /** 
     1141                 * Sets the m_flagClaimed. 
     1142                 */ 
     1143                public void setFlagClaimed() 
     1144                { 
     1145                        m_flagClaimed++; 
     1146                } 
     1147 
     1148        } 
    7331149} 
    7341150 
  • trunk/twcore/twcore/bots/matchbot/MatchRound.java

    r2 r3  
    224224                        if (m_team1.getFrequency() == freq) 
    225225                        { 
    226                                 m_team1.ownFlag(); 
     226                                m_team1.ownFlag(event.getPlayerID()); 
    227227                                m_team2.disownFlag(); 
    228228                        } 
     
    230230                        if (m_team2.getFrequency() == freq) 
    231231                        { 
    232                                 m_team2.ownFlag(); 
     232                                m_team2.ownFlag(event.getPlayerID()); 
    233233                                m_team1.disownFlag(); 
    234234                        } 
  • trunk/twcore/twcore/bots/matchbot/MatchTeam.java

    r2 r3  
    173173                                String playerName = m_botAction.getPlayer(event.getKillerID()).getPlayerName(); 
    174174                                MatchPlayer p = getPlayer(playerName); 
    175                                 p.reportKill(event.getScore()); 
     175                                p.reportKill(event.getScore(), event.getKilleeID()); 
    176176                        } 
    177177                        catch (Exception e) 
    178178                        { 
     179                                Tools.printStackTrace(e); 
    179180                        }; 
    180181                }; 
     
    11721173         * @author FoN 
    11731174         */ 
    1174         public void ownFlag() 
     1175        public void ownFlag(int playerID) 
    11751176        { 
    11761177                if (m_round.m_fnRoundState == 3 && m_flagOwned == false) 
    11771178                { 
     1179                        String playerName = m_botAction.getPlayer(playerID).getPlayerName(); 
     1180                        MatchPlayer p = getPlayer(playerName); 
     1181                        p.reportFlagClaimed(); 
    11781182                        m_flagOwned = true; 
    11791183                }